: except options on routes that do not contain collections and members

Currently, route exceptions are still displayed when I run rake routes .

 resources :userhome, :except => [:new, :create, :edit, :update, :show, :destroy] do collection do post :create_invitation end member do get :edit_profile_picture post :update_profile_picture end end 

How can I make exceptions?

+4
source share
1 answer

An easier way to eliminate unnecessary routes is to specify the option :only

 resources :userhome, :only => [:index] 

instead

 resources :userhome, :except => [:new, :create, :edit, :update, :show, :destroy] 
+15
source

All Articles