rails/rails — Issue #5318: Nested namespaced routes using scope
Author: Micr0mega
Created: 2012-03-07 11:10:25+00:00
State: open

Having two models/controllers in different namespaces in your routes, always prepends the parent resource namespace/scope to the child. This might not be desirable, but seemingly cannot be prevented.

See the following gist example: https://gist.github.com/1992303

The URL paths are correct and as expected, but the controller path is incorrect: it should be "people/users" instead of "library/people/users".

A workaround would be to completely remove the scope and use :controller => :"name/space/controller"

resources :books, :controller => :"library/books" do
resource :users, :controller => :"people/users"
end

I feel this is undesirable as scope :module should be used for this.

There does not seem to be any way to ignore the parent's scope with nested scopes.