Here are my params:
{"utf8"=>"✓", "authenticity_token"=>"g0mNoBytyd0m4oBGjeG3274gkE5kyE3aPbsgtqz3Nk4=", "commit"=>"Save changes", "plan_date"=>{"24"=>{"recipe_id"=>"12"}, "25"=>{"recipe_id"=>"3"}, "26"=>{"recipe_id"=>"9"}}}
How do I permit:
"plan_date"=>{"24"=>{"recipe_id"=>"12"}, "25"=>{"recipe_id"=>"3"}, "26"=>{"recipe_id"=>"9"}}
To get an output that looks like:
permitted_params = ["24"=>{"recipe_id"=>"12"}, "25"=>{"recipe_id"=>"3"}, "26"=>{"recipe_id"=>"9"}]
So that I can use the following to save:
permitted_params.each do |id, attributes|
Object.find_by_id(id.to_i)
Object.update_attributes(attributes)
end
I'm trying the following, but it's not working:
def permitted_params
params.require(:plan_date).permit(:id => [:recipe_id])
end
My version in fact, isn't letting anything go through =(