method
array_filter?
rails latest stable - Class:
ActionController::Parameters
array_filter?(filter)private
When an array is expected, you must specify an array explicitly using the following format:
params.expect(comments: [[:flavor]])
Which will match only the following array formats:
{ pies: [{ flavor: "rhubarb" }, { flavor: "apple" }] } { pies: { "0" => { flavor: "key lime" }, "1" => { flavor: "mince" } } }
When using `permit`, arrays are specified the same way as hashes:
params.expect(pies: [:flavor])
In this case, `permit` would also allow matching with a hash (or vice versa):
{ pies: { flavor: "cherry" } }