I pass a params like this
{
"utf8" => true,
"supply" => {
"items" => { 111 => 112, 89 => 10},
"another_params" => "something"
}
}
My supply_params
are:
params.fetch(:supply, {}).permit(:another_params, items: {})
But I get an unpermitted parameters 111 and 89
. How can I make items
permit all kinds of keys?
This thread in github provides a solution:
The idea is to explicitly permit any known attributes which are needed and then tack on nested attributes.