Customize Devise pathnames

前端 未结 1 1129
被撕碎了的回忆
被撕碎了的回忆 2021-01-21 22:12

I am trying to customize the urls created by the devise gem:

devise_for :users, path: \'\', path_names: {
    sign_in: \'login\',
    sign_out: \'logout\',
    s         


        
相关标签:
1条回答
  • 2021-01-21 22:43

    From the documentation, it looks like you can use a block to more define the routes as you would normally.

    devise_for :users, skip: [:sessions, ...]
    as :user do
      get 'login', to: 'sessions#new', as: :new_user_session
      get 'logout', to: 'sessions#destroy', as: :destroy_user_session
      ...
    end
    
    0 讨论(0)
提交回复
热议问题