In a Rails 5.1 app, from my view, I send the following to my controller
"area"=>{"name"=>"name", "project_id"=>"123", "owners"=>{"step2"=>["345", "678"], "step3"=>["123"]}}
How can I, with Strong Parameters, allow the entire content of owners
to get through?
I have tried what suggested in Rails 4 - Strong Parameters - Nested Objects but nothing seems to work.
params.require(:area).permit(:name, :project_id, :owners)
params.require(:area).permit(:name, :project_id, owners: [])
params.require(:area).permit(:name, :project_id, owners: []).tap do |whitelisted|
whitelisted[:owners] = params[:application_area][:owners]
end #=> ActionController::UnfilteredParameters - unable to convert unpermitted parameters to hash:
The content of the owners
hash may change from request to request; i.e. the next time I can send
"area"=>{"name"=>"name", "project_id"=>"123", "owners"=>{"color"=>["345", "678"], "shape"=>["123"]}}