LEEDLE LEEDLE LEEE
This commit is contained in:
parent
5ba8b751c3
commit
c107cb19cb
|
@ -25,7 +25,7 @@ class Ajax::ReportController < ApplicationController
|
||||||
|
|
||||||
obj = params[:type].strip.capitalize
|
obj = params[:type].strip.capitalize
|
||||||
|
|
||||||
object = case params[:type].strip.capitalize
|
object = case obj
|
||||||
when 'User'
|
when 'User'
|
||||||
User.find_by_screen_name params[:id]
|
User.find_by_screen_name params[:id]
|
||||||
when 'Question'
|
when 'Question'
|
||||||
|
@ -43,7 +43,11 @@ class Ajax::ReportController < ApplicationController
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if obj == 'User'
|
||||||
|
current_user.report object, params[:reason]
|
||||||
|
else
|
||||||
current_user.report object.find(params[:id]), params[:reason]
|
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])
|
||||||
|
|
Loading…
Reference in New Issue