I have the following routes:
namespace :admin do
scope 'foo', module: 'foo' do
resources :bar
resources :baz
end
scope 'lorem', module: 'lorem' do
resources :ipsum
resources :baz
end
end
Now, I’d like the ‘baz’ resource to use the same controller (found at controllers/admin/baz_controller.rb but I’m unsure how to tell Rails I want these resources under separate namespaces but to use the same controller.
Maybe this can help.
Note that you need to use
as:to be able to generate paths. But they can be something else.Not sure if you also need to add module parameter, but you got the idea.