I have this set of routes
resources :flatfiles do
collection do
delete :custom_destroy
end
end
And I would like to all of the routes to include :key
E.g. get 'flatfiles/:key' => 'flatfiles#index'
I could specify each route individually (like the get action above), but is there a way to do them all at once?
You can use :path
resources :flatfiles, path: 'flatfiles/:key' do
collection do
delete :custom_destroy
end
end
That will prefix all sub routes with :key