未登录500报错

This commit is contained in:
yanxd 2014-04-23 09:20:09 +08:00
parent 60bc3bb1b2
commit d9cadfc43e
1 changed files with 4 additions and 1 deletions

View File

@ -3,11 +3,14 @@ require_dependency "seems_rateable/application_controller"
module SeemsRateable
class RatingsController < ApplicationController
def create
raise NoCurrentUserInstanceError unless current_user
raise Errors::NoCurrentUserInstanceError unless current_user
obj = params[:kls].classify.constantize.find(params[:idBox])
obj.rate(params[:rate].to_i, current_user.id, params[:dimension])
render :json => true
rescue Errors::NoCurrentUserInstanceError
render :json => {:error => 'you must be login.'}
end
end
end