Answer the question
In order to leave comments, you need to log in
Why don't rails 4 and gem letsrate drop data into the database?
Installed the letsrate gem, everything works, except that the data does not fall into the database ... I think the problem is in strong parameters, I don’t know how to add strong parameters to the rater_controller, can anyone come across it?
or maybe the problem is something else, Google is silent (strange)
class RaterController < ApplicationController
def create
if current_user.present?
obj = eval "#{params[:klass]}.find(#{params[:id]})"
if params[:dimension].present?
obj.rate params[:score].to_i, current_user.id, "#{params[:dimension]}"
else
obj.rate params[:score].to_i, current_user.id
end
render :json => true
else
render :json => false
end
end
end
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question