How to Remove/Disable Sign Up From Devise

前端 未结 6 1310
余生分开走
余生分开走 2021-02-05 02:56

I\'m trying to remove/disable the user/sign_up path from Devise. I\'m doing this because I don\'t want random people gaining access to the application. I have it p

6条回答
  •  佛祖请我去吃肉
    2021-02-05 03:00

    Since as is just an alias for devise_scope, you can put all that in just one block.

    devise_for :users, skip: [:registrations]
    as :user do
      get "/sign_in" => "devise/sessions#new" # custom path to login/sign_in
      get "/sign_up" => "devise/registrations#new", as: "new_user_registration" # custom path to sign_up/registration
      get 'users/edit' => 'devise/registrations#edit', :as => 'edit_user_registration'
      put 'users' => 'devise/registrations#update', :as => 'user_registration'
    end
    

提交回复
热议问题