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

This commit is contained in:
lizanle 2015-11-09 11:27:05 +08:00
parent 2d321d2dbc
commit 2e092b0d04
2 changed files with 3 additions and 3 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: 20000
validates_length_of :content, maximum: 30000
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,8 +76,8 @@
$("#error").html("主题 过长(最长为 50 个字符)").show();
return false;
}
if(memo_content.html().length > 20000){
$("#error").html("内容 过长(最长为 20000 个字符)").show();
if(memo_content.html().length > 30000){
$("#error").html("内容 过长(最长为 30000 个字符)").show();
return false;
}
return true;