This project is archived and is in readonly mode.
nested resource routes not generated correctly (rails 2.3)
-
Sam Ruby
I've verified that this happens in Rails 2.3.4, but not in Rails 2.3.3.
-
Tom Stuart
Yeah, this is broken.
FWIW you can turn on the old routing behaviour by commenting out the
ActionController::Routing.generate_best_match = falseline in config/initializers/new_rails_defaults.rb, which Josh introduced in commit 6fdfe4cb5fa85160f5d91bad64d5c23b4f87f820. -
josh
- State changed from new to open
@Ian does using the 2.x generation behavior fix this issue? Or is it present in both cases?
-
Tom Stuart
Yes, using the 2.x generation behaviour (
ActionController::Routing.generate_best_match = true) fixes the problem. -
Ian White
@Josh, as Tom says, using
generate_best_matchfixes it. As does flipping the order of the route declaration.Is this expected Rails 3 behaviour?
-
josh
- State changed from open to invalid
Correct.
"ActionController::Routing.generate_best_match = false" is the default option for new projects since it is going to be the only option in Rails 3.
-
Tom Stuart
Which is why this ticket is valid: the breakage occurs when
ActionController::Routing.generate_best_match = false. -
Tom Stuart
Oh, I see, it's actually meant to work like this. Never mind.
-
Sam Ruby
But Rails 3.0 does not behave this way.
http://intertwingly.net/projects/AWDwR3/checkdepot-2.3.3.html
http://intertwingly.net/projects/AWDwR3/checkdepot-2.3.4.html
http://intertwingly.net/projects/AWDwR3/checkdepot.html[ at the moment, 3.0 has an unrelated failure, which is documented here: #3214 transactions don't fail in 3.0 ]
-
josh
@Sam, this patch has not been applied to master since the current router will be completely rewritten. The motivation for this switch in 2.x is to easy the pain of upgrading to the new router. Rails 3.0 will not have this flag. All routes will be generated identical to the "ActionController::Routing.generate_best_match = false" behavior.
I'm still in the progress of integrating the new router into master. I expect a few more weeks of work are left.