I'm having issues with Rails 4 Strong Parameters. The thing is I try to pass some parameters that look like this and it raises a ForbiddenAttributesError exception afterwards:
"survey_answer"=>{"a1"=>"answer_1",
"a2"=>"answer_1",
"a3"=>"answer_3",
"a4"=>["test1",
"test2",
"test3"],
"a7"=>"answer_7",
"name"=>"Test name",
"industry"=>"Test industry",
"email"=>"[email protected]"}}
As you can see, a4 comes from a check box that yields an array of values. My proposed solution to this point is this:
params.require(:survey_answer).permit(:a1, :a2, :a3, :a7, :name, :email, :industry, :a4 => [], :a5, :a6)
Unfortunately no matter how I refactor I still get to the same point.