Nested Namespace in Rails 2.0

Apr 13 2008

$> mate config/routes.rb

map.namespace :admin do |admin|
  admin.resources :user
end

$> rake routes

admin_user_index GET    /admin/user
  {:controller=>'admin/user', :action=>'index'}
......

$> mate config/routes.rb

map.namespace :admin do |admin|
  admin.namespace :user do |user|
    user.resources :profile
  end
end

$> rake routes

admin_user_profile_index GET    /admin/user/profile
  {:controller=>'admin/user/profile', :action=>'index'}
......
Tags: ,

No responses yet

Leave a Reply