How do I remove the Devise route to sign up?

后端 未结 15 2420
佛祖请我去吃肉
佛祖请我去吃肉 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条回答
  •  没有蜡笔的小新
    2020-12-07 08:28

    you can do this in your model

    # typical devise setup in User.rb
    devise :database_authenticatable, :registerable, :recoverable, :rememberable, :trackable, :validatable
    

    change it to:

    devise :database_authenticatable, :recoverable, :rememberable, :trackable, :validatable
    

    notice that the symbol :registerable was removed

    That's it, nothing else is required. All routes and links to registration page are magically removed too.

提交回复
热议问题