防止url删减报错

url博客内容长度限制改为20000
This commit is contained in:
lizanle 2015-10-26 10:54:27 +08:00
parent eaf4ad354f
commit 69bc26033e
2 changed files with 7 additions and 3 deletions

View File

@ -28,7 +28,11 @@ class BlogsController < ApplicationController
end
private
def find_blog
@blog = Blog.find(params[:blog_id])
if params[:blog_id]
@blog = Blog.find(params[:blog_id])
else
render_404
end
if @blog.nil?
#如果某个user的blog不存在那么就创建一条
@blog = Blog.create(:name=>User.find(params[:id]).realname ,

View File

@ -40,8 +40,8 @@ function regexTopicDescription()
$("#message_content_span").css('color','#ff0000');
return false;
}
else if(name.length >=6000){
$("#message_content_span").text("描述最多3000个汉字(或6000个英文字符)");
else if(name.length >=20000){
$("#message_content_span").text("描述最多20000个汉字(或40000个英文字符)");
$("#message_content_span").css('color','#ff0000');
return false;
}