论坛字符允许扩大为40000个字符

This commit is contained in:
lizanle 2015-11-09 11:14:24 +08:00
parent 8e66bb8fe1
commit 4b272b6b9c
2 changed files with 5 additions and 5 deletions

View File

@ -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"

View File

@ -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;
}