I've split my rails app into a admin directory and a public directory.
The admin directory is within an Admin:: namespace (/admin).
When I created a controller called Forums in both the Admin:: namespace and the normal root map area, the routing seems to find the Admin::Forums controller for /forums and /admin/forums.
So /admin/forums => "app/controllers/admin/forums_controller.rb" So /forums => "app/controllers/admin/forums_controller.rb"
Not sure why this is happening, are the root controllers somehow inherited amoung both controllers? When I try to execute code within the non-admin forums controller, nothing gets exercuted.
Here is my route:
map.resources :forums, :only => [:index,:show] do |forum|
forum.resources :topics, :shallow => true, :only => [:index,:show], :name_prefix => ""
end
map.namespace :admin, :name_prefix => "", :path_prefix => "/admin", :name_prefix => "admin_" do |admin|
admin.resources :forums, :name_prefix => 'admin_' do |forum|
forum.resources :topics, :name_prefix => 'admin_' do |topic|
topic.resources :posts, :name_prefix => 'admin_'
end
end
end
Any ideas?