未登录500报错
This commit is contained in:
parent
60bc3bb1b2
commit
d9cadfc43e
|
@ -3,11 +3,14 @@ require_dependency "seems_rateable/application_controller"
|
||||||
module SeemsRateable
|
module SeemsRateable
|
||||||
class RatingsController < ApplicationController
|
class RatingsController < ApplicationController
|
||||||
def create
|
def create
|
||||||
raise NoCurrentUserInstanceError unless current_user
|
raise Errors::NoCurrentUserInstanceError unless current_user
|
||||||
obj = params[:kls].classify.constantize.find(params[:idBox])
|
obj = params[:kls].classify.constantize.find(params[:idBox])
|
||||||
obj.rate(params[:rate].to_i, current_user.id, params[:dimension])
|
obj.rate(params[:rate].to_i, current_user.id, params[:dimension])
|
||||||
|
|
||||||
render :json => true
|
render :json => true
|
||||||
|
|
||||||
|
rescue Errors::NoCurrentUserInstanceError
|
||||||
|
render :json => {:error => 'you must be login.'}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue