I want to permit nested custom parameters but am not sure how to access them.
These are my params:
params=>
{"utf8"=>"✓",
"authenticity_token"=>"...",
"tracking"=>{"installation"=>"4", "code"=>[{"1"=>"one", "2"=>"two"}]},
"action"=>"create",
"controller"=>"admin/trackings"}
According to the Strong Parameters documentation I tried some combinations like this:
def tracking_params
params.require(:tracking).permit(:installation, code: [])
end
but they are not working. What am I missing?
Have you tried solving this on the model level? I think you just need to add:
Not sure what your Rails version is, but the docs for Rails 5.1.2 seem to cover this