How do I remove the Devise route to sign up?

后端 未结 15 2364
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-07 07:36

I\'m using Devise in a Rails 3 app, but in this case, a user must be created by an existing user, who determines what permissions he/she will have.

Because of this, I

15条回答
  •  Happy的楠姐
    2020-12-07 08:37

    Instead of searching for a hard solution. I used the below approaches.

    1. Delete the sign_up form from page (path devise/registrations/new.html.erb) and replace it with custom info.

    2. Redirect the incoming traffic to some other page. Like below in routes.rb

        get "/users/sign_up", to: redirect('/')
    
        post "/users/sign_up", to: redirect('/')
    

    Make sure to write it before devise_for :users

提交回复
热议问题