This project is archived and is in readonly mode.
Nested resource constraints are applied incorrectly
Reported by Andrew White | August 31st, 2010 @ 05:52 PM | in 3.0.2
When using nested resource id constraints the options are applied incorrectly because the implicit nested call occurs after the options have been pushed out to the scope, e.g:
resources :lists, :id => /([A-Za-z0-9]{25})|default/ do
resources :todos, :id => /\d+/
end
Specifying the routes in full gives the correct results:
resources :lists, :constraints => { :id => /([A-Za-z0-9]{25})|default/ } do
nested do
resources :todos, :constraints => { :id => /\d+/ }
end
end
The attached patch moves the nested call before the options are processed.
Comments and changes to this ticket
-
José Valim September 1st, 2010 @ 08:45 AM
Andrew, sorry but the patch no longer applied. Could you please rebase?
-
Repository September 1st, 2010 @ 09:15 AM
- State changed from open to resolved
(from [9441eabbbfd46b117fe4ea4667369e5564def9cb]) Move implicit nested call before options handling so that nested constraints work [#5513 state:resolved]
Signed-off-by: José Valim jose.valim@gmail.com
http://github.com/rails/rails/commit/9441eabbbfd46b117fe4ea4667369e... -
Repository September 1st, 2010 @ 09:15 AM
(from [02480a897be25c24f59180513d37649a31ad3835]) Move implicit nested call before options handling so that nested constraints work [#5513 state:resolved]
Signed-off-by: José Valim jose.valim@gmail.com
http://github.com/rails/rails/commit/02480a897be25c24f59180513d3764...
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
<h2 style="font-size: 14px">Tickets have moved to Github</h2>
The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>
People watching this ticket
Attachments
Referenced by
- 5513 Nested resource constraints are applied incorrectly (from [9441eabbbfd46b117fe4ea4667369e5564def9cb]) Move im...
- 5513 Nested resource constraints are applied incorrectly (from [02480a897be25c24f59180513d37649a31ad3835]) Move im...