This project is archived and is in readonly mode.
url_for ignores routing priority
-
Colin MacKenzie IV
This issue appears to also be present in Rails 2.3.2 / Ruby 1.8.6 WinXP.
-
Colin MacKenzie IV
This seems to have solved the problem for me.
-
Colin MacKenzie IV
Erg, dumb error in previous code. That's what I get for trying to make things pretty. :) New attachment:
-
CancelProfileIsBroken
- Tag set to bugmash
-
Gabe da Silveira
verified the bug on 2-3-stable.
The problem is that the prioritization algorithm for routes, which depends on the number of matching components, does not preserve the order for routes of equal weight. I couldn't find an obvious place to test this, and frankly I don't care enough to put any more time into it, but I have a simple solution that makes the algorithm more robust and doesn't break any existing tests.
I've attached a patch.
-
Rizwan Reza
verified
+1 This patch applies cleanly to master as well.
-
Tristan Dunn
- Tag changed from bugmash to bugmash, verified
+1
Verified it applies cleanly to master and 2-3-stable with passing tests.
-
Elad Meidar
+1 verified, applied and successfully tests (manual as well) on master and 2-3-stable
-
Dan Croak
+1 verified Gabe's patch applies to 2-3-stable and actionpack rake test runs green.
-
josh
- Assigned user set to josh
- State changed from new to invalid
- Tag cleared.
- Milestone changed from 2.x to 2.3.4
We are killing this sorting "feature" in 3.0. I'm working on a deprecation for 2.3 that will return the routes in the original priority ordering.
-
Gabe da Silveira
I don't understand why you wouldn't just apply this in the meantime since it fixes an legitimate issue. It's not really invalid.
-
Gabe da Silveira
So you deprecated it, but A) my patch would have still cleanly applied and B) the original issue still exists. At least it should be wontfix.
