Reputation: 4087
In routes.rb i've declared:
resources :photos
How can i map the /photos/new route with /admins/photos/new? With namespaces?
Thanks
Upvotes: 0
Views: 53
Reputation: 7978
See Chapter 2.6 of Rails Routing Guide.
You may wish to organize groups of controllers under a namespace. Most commonly, you might group a number of administrative controllers under an Admin:: namespace. You would place these controllers under the app/controllers/admin directory, and you can group them together in your router:
namespace :admin do
resources :posts, :comments
end
Upvotes: 2