还原新建贴吧报贴吧名已存在的问题

This commit is contained in:
daiao 2016-10-14 21:05:40 +08:00
parent 64d446e480
commit 3ceee6522b
1 changed files with 5 additions and 5 deletions

View File

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