I’m clueless about whitelisting. Where do I put the
if %w(some valid input).include?(params[:input])
# proceed with action
else
# not in whitelist, throw error
end
and how do I call it from the submit action of a form?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I don’t really know what you expect but this could be the job of a
before_filter.It’d keep your controller dry. See doc.
In your controller, try this: