This project is archived and is in readonly mode.

#5513 ✓resolved
Andrew White

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+/

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+/ }

The attached patch moves the nested call before the options are processed.

Comments and changes to this ticket

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=""></a>

Referenced by