I’m designing my admin panel for a cms and I want to have for example Downloads, Images and Articles. Each of these elements can be categorized, so I have an action “categories” on each controller(Downloads, Images and Articles).
In my routes file I have the following:
namespace :admin do
resources :downloads
resources :images
resources :articles
end
My problem is that the above code only creates routes for index, show, edit, update and destroy. Is there a method of adding the categories action to all resources once, without declaring it 3 times?
1 Answer