I am having trouble getting routing namespaces to persist through nested resource routes.

I would like this to work:
map.namespace(:admin) do |admin|
   admin.resources :foos do |foo|
     foo.resources :bars
   end
 end

...where I have a Admin::FoosController and a Admin::BarsController.

But it throws this NameError:
uninitialized constant BarsController

Which looks like it didn't carry the namespace down to the resource. So, the next best thing might be something like this:
 map.namespace(:admin) do |admin|
   admin.resources :foos, :namespace => "admin" do |foo|
     foo.resources :bars
   end
 end

But in the meanwhile, I'm having to resort to this, which works, but isn't pretty:
map.namespace(:admin) do |admin|
   admin.resources :foos do |foo|
     foo.resources :bars, :controller => "Admin::Bars"
   end
 end

If anybody has any insight... I would sure appreciate it.

-Nate
_______________________________________________
Sdruby mailing list
[email protected]
http://lists.sdruby.com/mailman/listinfo/sdruby

Reply via email to