rails: Rails route URL helpers do not handle strong parameters `format` correctly
Steps to reproduce
git clone https://github.com/codeodor/rails-issue-with-format
cd rails-issue-with-format
rails s
open http://localhost:3000/tests
Expected behavior
The two URLs output should be identical.
Actual behavior
The first example sticks a parameter in the URL for format
instead of changing the extension.
Rails’ controllers behave fine when responding to these links – the controller still responds with the requested format. But Turbolinks does not see this as an extension it should avoid, which causes it to send a request with a different format than the server responds with.
System configuration
Rails version: 5.1.3
Ruby version: 2.3.0
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 18 (13 by maintainers)
I can reproduce:
@codeodor You are right, this was only for tests.
I would like someone else to also take a look at this before I start fixing it and to confirm what should be the expected outcome.
They’re not both incorrect:
tests_path("params" => {"format" => "pdf"})
should give/tests?format=pdf