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