Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

routes => :except being inherited by sub-level resources

#5048

This route declaration

resources :artists, :except => [:new,:create] do
  resources :releases do
    resources :tracks
  end
end

Supresses the :new and :create routes for releases and tracks too. To put them back in I had to:

resources :artists, :except => [:new,:create] do
  resources :releases, :except => [:none] do
    resources :tracks
  end
end

Which seems odd. Is this the new expected behavior?

Reported by Rafael Barbosa · July 5th, 2010 @ 04:09 PM

State: resolved
Milestone: none
Assigned to: nobody
Importance: none

Activity

  1. Tatsuro BABA
    Tatsuro BABA

    +1 I just encountered exactly the same problem.
    So, attached a patch with failing test cases.

    July 6th, 2010 @ 04:30 AM

  2. Repository
    Repository
    • State changed from new to resolved

    (from [f4be0041c605daad2406ec41fa7dfa4388af5f31]) Refactor handling of :only and :except options. The rules are:

    1. Don't inherit when specified as an option on a resource
    2. Don't push into scope when specified as an option on a resource
    3. Resources pull in :only or :except options from scope
    4. Either :only or :except in nested scope overwrites parent scope

    [#5048 routes => :except being inherited by sub-level resources state:resolved]

    Signed-off-by: José Valim jose.valim@gmail.com
    http://github.com/rails/rails/commit/f4be0041c605daad2406ec41fa7dfa...

    July 6th, 2010 @ 08:06 PM