You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The parse_query_parameters method exhibits behavior different from Rack::Utils#parse_nested_query when receiving a query string containing duplicate keys. Given a params string like "foo=bar&foo=baz", Rack::Utils#parse_nested_query will return the last instance of foo resulting in {"foo" => "baz"}. Given the same parameter string, parse_query_parameters returns the first instance of foo resulting in {"foo" => "bar"}. This difference in behavior causes the Rails check_box form helper to always submit a zero value because of the hidden input rails inserts box the checkbox input.
The text was updated successfully, but these errors were encountered:
I'm inclined just to gut the vast majority of the code in NestedParams and pass the request body off to Rack::Utils.parse_nested_query. Anyone disagree? It'll be a behaviour change, though, so it won't be a candidate for an actual fix until 2.0.
Sounds fine to me. Looks like it has a decent set of tests, so we could swap out the guts with confidence. @nladd, could you write us a failing test which illustrates the problem?
The parse_query_parameters method exhibits behavior different from Rack::Utils#parse_nested_query when receiving a query string containing duplicate keys. Given a params string like "foo=bar&foo=baz", Rack::Utils#parse_nested_query will return the last instance of foo resulting in {"foo" => "baz"}. Given the same parameter string, parse_query_parameters returns the first instance of foo resulting in {"foo" => "bar"}. This difference in behavior causes the Rails check_box form helper to always submit a zero value because of the hidden input rails inserts box the checkbox input.
The text was updated successfully, but these errors were encountered: