开发者

: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
 开发者_如何学Python   post :create_invitation
  end
  member do
    get :edit_profile_picture
    post :update_profile_picture
  end
end

How can I make the exceptions work?


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]
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜