I have the following resources
resources :countries do resources :cities end resources :cities do resources :streets end
it generates the following routes
GET /countries/:country_id/cities(.:format) cities#index POST /countries/:country_id/cities(.:format) cities#create new_country_city GET /countries/:country_id/cities/new(.:format) cities#new edit_country_city GET /countries/:country_id/cities/:id/edit(.:format) cities#edit GET /countries/:country_id/cities/:id(.:format) cities
I donβt want access to cities without a country identifier, but also I donβt want to use 3-level invested resources, so I can change routes, like the following
resources :countries do resources :cities end resources :cities, :except => [:index, :destroy, :edit, :show, :create, :new, :update] do resources :streets end
Is there any shortcut to disable all actions instead of recording all actions by default: except for the option ????
Fivell
source share