Reputation: 37
When sending params to a rails controller like from a test or a view
{ "a[b]" => true }
I receive it as
{"a" => {"b" => true}}
I would like to know how this happens
Upvotes: 0
Views: 53
Reputation: 1276
This happened because rails middleware convert this type of parameter into hash so that it is more easy to access and use. You can have more in depth info in Rails guide.
Upvotes: 2