Do you feel it, Mr. Krabs?

This commit is contained in:
Yuki 2015-09-18 18:09:26 +09:00
parent c107cb19cb
commit e510a6e8b4
1 changed files with 5 additions and 9 deletions

View File

@ -29,13 +29,13 @@ class Ajax::ReportController < ApplicationController
when 'User' when 'User'
User.find_by_screen_name params[:id] User.find_by_screen_name params[:id]
when 'Question' when 'Question'
Question Question.find params[:id]
when 'Answer' when 'Answer'
Answer Answer.find params[:id]
when 'Comment' when 'Comment'
Comment Comment.find params[:id]
else else
Answer Answer.find params[:id]
end end
if object.nil? if object.nil?
@ -43,11 +43,7 @@ class Ajax::ReportController < ApplicationController
return return
end end
if obj == 'User'
current_user.report object, params[:reason] current_user.report object, params[:reason]
else
current_user.report object.find(params[:id]), params[:reason]
end
@status = :okay @status = :okay
@message = I18n.t('messages.report.create.okay', parameter: params[:type]) @message = I18n.t('messages.report.create.okay', parameter: params[:type])