Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

:except options in routes that contain collections and members not working

Currently the route exceptions are still showing up 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 the exceptions work?

like image 297
Jay Avatar asked Jun 24 '11 02:06

Jay


1 Answers

A simpler way to eliminate unneeded routes is by specifying the :only option

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

instead of

resources :userhome, :except => [:new, :create, :edit, :update, :show, :destroy]
like image 88
Hck Avatar answered Oct 11 '22 14:10

Hck