rails/rails — pull request #13863 by joshjordan (2014-01-28 22:03:44+00:00)
Title: Do not discard query parameters on requests that use wrap_parameters

This PR fixes the case where the GET parameters tried to form a hash, but `wrap_parameters` caused them to be overwritten by an empty hash.

To expand on what the test case shows, we ran into a realistic example wherein we had query string parameters that matched the format of a form POST, so that we could reuse a particular controller action elsewhere in our application. Think of something like this:

```
link_to 'Search', search_path(search: { term: 'bill' }), remote: true
```

This allows compatibility with the same controller action you might use for a form that looks like this:
```
form_for @search do |f|
f.text_field :term
f.submit
end
```

Strangely, because of the current implementation of `ActionController::ParamsWrapper`, this caused a failure when used with content-type `application/json` (which, in our application, is wrapped), but not with a plain 'ol HTML request (which is not). I find this to be confusing and don't see a reason to discard GET parameters in this case.

All existing test cases pass.