还原新建贴吧报贴吧名已存在的问题
This commit is contained in:
parent
64d446e480
commit
3ceee6522b
|
@ -296,12 +296,12 @@ class ForumsController < ApplicationController
|
||||||
|
|
||||||
#检查forum的名字
|
#检查forum的名字
|
||||||
def check_forum_name
|
def check_forum_name
|
||||||
forum_name_exist = false
|
forum_name_exist = true
|
||||||
# if params[:forum_id]
|
if params[:forum_id]
|
||||||
# forum_name_exist = Forum.where("name = '#{params[:forum_name]}' and id != #{params[:forum_id]}").count >= 1 ? true : false
|
forum_name_exist = Forum.where("name = '#{params[:forum_name]}' and id != #{params[:forum_id]}").count >= 1 ? true : false
|
||||||
# else
|
else
|
||||||
forum_name_exist = Forum.where("name = '#{params[:forum_name]}' ").count >= 1 ? true : false
|
forum_name_exist = Forum.where("name = '#{params[:forum_name]}' ").count >= 1 ? true : false
|
||||||
# end
|
end
|
||||||
render :text => forum_name_exist
|
render :text => forum_name_exist
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue