Step on how to add devise migration to existing User model in ruby on rails?

后端 未结 2 1325
栀梦
栀梦 2020-12-15 12:20

I have a User model created already. I am wondering how should I configure devise with my existing User model. That being said, do I need to setup any additional routes or m

相关标签:
2条回答
  • 2020-12-15 12:52

    Just add devise_for :user in your routes

    Add attr_accessible :password, :password_confirmation

    and for more info take a look at a typical devise model

    https://github.com/johndel/Rails-Simple-CMS/blob/master/app/models/admin.rb

    (Pretty simple)

    0 讨论(0)
  • 2020-12-15 12:52

    You can simply run:

    rails generate devise User
    

    to add devise to the User model.

    0 讨论(0)
提交回复
热议问题