ruby on rails - Namespaced Routes give me Unitialized constant Admin::Towers -
ruby on rails - Namespaced Routes give me Unitialized constant Admin::Towers -
the 2 particular routes im having issues admin/inspections , admin/activities. when first save routes.rb, whichever route load first works other not, gives me error: "unitialized constant admin::towers"
i have next routes setup.
namespace :admin #...etc... resources :inspections, only: [:index,:show], controller: 'towers/inspections' resources :activities, only: [:index], controller: 'towers/activities' end
as you've namespaced resources, controllers should reside within app/controllers/admin/*
, have name, i.e. inspections: class admin::inspectionscontroller
i'm guessing have:
scope '/admin' resources :inspections, only: [:index,:show], controller: 'towers/inspections' resources :activities, only: [:index], controller: 'towers/activities' end
ruby-on-rails ruby-on-rails-3 rails-routing
Comments
Post a Comment