This project is archived and is in readonly mode.
Routing with a blank path_prefix causes a bad url to generate
-
Andrew Bloom
- Tag changed from 2.x, routing to 2.2, 2.3, edge, patch, routing
previous patch was against tags/2.3.0, this new one is against edge and has more tests.
-
Andrew Bloom
It appears ticket #1571 Routing with empty path_prefix should not add two / to the url is about the same problem.
-
Michael Koziarski
I'm not sure I follow why you're passing an empty string there though? Seems wrong to just silently ignore a value that was passed?
-
Andrew Bloom
The blank string came when trying to build routes like this:
path_prefix = (%w(development test).include?(RAILS_ENV) ? "admin" : "") map.namespace(:admin, :path_prefix => path_prefix) do |admin|
...end
Yes, it could easily by fixed by making the conditional return nil instead of "", but it still seems like adding the / when there is no slug isn't appropriate.
-
Andrew Bloom
path_prefix = (%w(development test).include?(RAILS_ENV) ? "admin" : "") map.namespace(:admin, :path_prefix => path_prefix) do |admin| ... end(can we get a preview function on comments before posting them?)
-
CancelProfileIsBroken
I'm +1 on this. We've had two different people hit this, the fixed behavior seems reasonably intuitive and I can't think of anything else we'd want to do with an empty :path_prefix.
-
Repository
- State changed from new to resolved
(from [90dba00822acd1e01f7a39625668ee74ffe5f061]) Ensure blank path_prefix works as expected [#2122 Routing with a blank path_prefix causes a bad url to generate state:resolved]
Signed-off-by: Pratik Naik pratiknaik@gmail.com http://github.com/rails/rails/co...
