问题
I have such route:
namespace admin
namespace :catalogs do
namespace :to do
resources :manufacturers do
resources :models do
resources :types do
resources :details
end
end
end
end
end
end
(please do not ask what's the model, why so man sub's: it must be so)
and such folder structure:

in manufacturer index view i have link: = link_to "Подробнее", admin_catalogs_to_manufacturer_model_path(c), :class=>'btn btn-primary'
(also rake routes say that it is right route)
and when i try to render my index view i get:
No route matches {:action=>"show", :controller=>"admin/catalogs/to/models", :manufacturer_id=>#}
when i custom my link to :
= link_to "Подробнее", admin_catalogs_to_manufacturer_model_path(manufacturer_id: c.MFA_ID, id: c.MFA_ID)
i get error
uninitialized constant Admin::Catalogs::To::ModelsController
what is wrong? how to solve my routing?
来源:https://stackoverflow.com/questions/16979826/rails-routing-with-subfolders-namespaces-and-resources