From 4b272b6b9c622dbc009da3de584847ae3a1cc083 Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Mon, 9 Nov 2015 11:14:24 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=BA=E5=9D=9B=E5=AD=97=E7=AC=A6=E5=85=81?= =?UTF-8?q?=E8=AE=B8=E6=89=A9=E5=A4=A7=E4=B8=BA40000=E4=B8=AA=E5=AD=97?= =?UTF-8?q?=E7=AC=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/memo.rb | 2 +- app/views/forums/show.html.erb | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/models/memo.rb b/app/models/memo.rb index 33b24db50..f6449a550 100644 --- a/app/models/memo.rb +++ b/app/models/memo.rb @@ -9,7 +9,7 @@ class Memo < ActiveRecord::Base # 若是主题帖,则内容可以是空 #validates :content, presence: true, if: Proc.new{|o| !o.parent_id.nil? } validates_length_of :subject, maximum: 50 - validates_length_of :content, maximum: 5000 + validates_length_of :content, maximum: 40000 validate :cannot_reply_to_locked_topic, :on => :create acts_as_tree :counter_cache => :replies_count, :order => "#{Memo.table_name}.created_at ASC" diff --git a/app/views/forums/show.html.erb b/app/views/forums/show.html.erb index 25a4fae46..3d239cff1 100644 --- a/app/views/forums/show.html.erb +++ b/app/views/forums/show.html.erb @@ -76,10 +76,10 @@ $("#error").html("主题 过长(最长为 50 个字符)").show(); return false; } -// if(memo_content.html().trim().length > 5000){ -// $("#error").html("内容 过长(最长为 5000 个字符)").show(); -// return false; -// } + if(memo_content.html().trim().length > 40000){ + $("#error").html("内容 过长(最长为 40000 个字符)").show(); + return false; + } return true; }