Sha256: 9f81bc570b5a1225b558baa984d6e5a405d2fbdd7d9e75dbb6e93322c90bf623

Contents?: true

Size: 469 Bytes

Versions: 3

Compression:

Stored size: 469 Bytes

Contents

require_dependency "seems_rateable/application_controller"

module SeemsRateable
  class RatingsController < ::ApplicationController
    def create
		 raise NoCurrentUserInstanceError unless current_user
		 
		 obj = params[:kls].classify.constantize.find(params[:idBox])
		 begin
			obj.rate(params[:rate].to_i, current_user.id, params[:dimension])
			render :json => true
		 rescue Errors::AlreadyRatedError
			render :json => {:error => true}
		 end
	 end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
seems_rateable-1.0.9 app/controllers/seems_rateable/ratings_controller.rb
seems_rateable-1.0.8 app/controllers/seems_rateable/ratings_controller.rb
seems_rateable-1.0.7 app/controllers/seems_rateable/ratings_controller.rb