Reputation: 49743
I'd like to have a namespace in Rails where the module name in code is different than the path name that user sees in the URL.
One can make a namespace in routes like so:
namespace :admin_ui do
resources :posts
end
and this will match /admin_ui/posts to AdminUI::PostsController
.
How can I make this namespace match the path /admin, but use module AdminUI
?
Upvotes: 7
Views: 3258
Reputation: 49743
Found it:
namespace :admin_ui, path: 'admin' do
resources :posts
end
Upvotes: 12