So lets consider the following in routes.rb
concern :shared_actions do
resources :courses do
resources :lessons
end
resources :users
end
my admin namespace has the following
namespace :admin do
concerns :shared_actions
get '', to:'dashboard#index', as: '/'
resources :lessons
end
and my root path '/' also shares the same concerns using
concerns :shared_actions
So what i want is,for the root path i want only index and show action for the courses path but in the admin namespace i want to have all actions for courses.
Is there a way to do that without writing explicit code for each case?
Aucun commentaire:
Enregistrer un commentaire