Namespaces that are controllers?

I’m checking out the new router in Rails 3, and was looking to create
an ‘/admin’ section of a website with several namespaced resources,
however I’d like the top level ‘/admin’ to also route to a
controller. Here’s my current setup:

match ‘admin’ => ‘admin#index’, :as => ‘admin’
namespace :admin do
resources :users
resources :roles
end

It seems to work fine, however I get the feeling that there is a
better way (perhaps a block on the ‘match’). Is that the ‘best’ way
to have ‘/admin’ respond with a page?

Thanks,
-Mike

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs