论坛字符允许扩大为30000个字符,超过两万个字符不允许提交

at_guange
lizanle 10 years ago
parent 2d321d2dbc
commit 2e092b0d04

@ -9,7 +9,7 @@ class Memo < ActiveRecord::Base
# 若是主题帖,则内容可以是空 # 若是主题帖,则内容可以是空
#validates :content, presence: true, if: Proc.new{|o| !o.parent_id.nil? } #validates :content, presence: true, if: Proc.new{|o| !o.parent_id.nil? }
validates_length_of :subject, maximum: 50 validates_length_of :subject, maximum: 50
validates_length_of :content, maximum: 20000 validates_length_of :content, maximum: 30000
validate :cannot_reply_to_locked_topic, :on => :create validate :cannot_reply_to_locked_topic, :on => :create
acts_as_tree :counter_cache => :replies_count, :order => "#{Memo.table_name}.created_at ASC" acts_as_tree :counter_cache => :replies_count, :order => "#{Memo.table_name}.created_at ASC"

@ -76,8 +76,8 @@
$("#error").html("主题 过长(最长为 50 个字符)").show(); $("#error").html("主题 过长(最长为 50 个字符)").show();
return false; return false;
} }
if(memo_content.html().length > 20000){ if(memo_content.html().length > 30000){
$("#error").html("内容 过长(最长为 20000 个字符)").show(); $("#error").html("内容 过长(最长为 30000 个字符)").show();
return false; return false;
} }
return true; return true;

Loading…
Cancel
Save