Class: SeemsRateable::RatingsController

Inherits:
ApplicationController show all
Defined in:
app/controllers/seems_rateable/ratings_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject

Raises:

  • (NoCurrentUserInstanceError)


5
6
7
8
9
10
11
# File 'app/controllers/seems_rateable/ratings_controller.rb', line 5

def create
  raise 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
end