Combining Devise with resources :users in Rails

前端 未结 3 468
孤独总比滥情好
孤独总比滥情好 2020-12-16 13:47

I am trying to combine Devise with a RESTful user resource using the following code in the routes.rb file:

resources :users, :only => [:index, :show]
devi         


        
3条回答
  •  孤街浪徒
    2020-12-16 14:18

    In the link David Sulc wrote is shown that you should write a prefix to device_for or resources Example:

    devise_for :users, :path_prefix => 'my'
    resources :users
    

    Or your users

    devise_for :users
    scope "/admin" do
      resources :users
    end
    

    Both works well for me

提交回复
热议问题