开发者

How to replace authentication system for Devise in Rails?

I have an authentication system made by hand with all the models and methods for sign in, etc. How hard is it to replace all that system for Dev开发者_C百科ise? I see Devise creates the models and that but in this case I already have them.

What steps should I follow?

Thank you.


You can install Devise as is instructed in the documentation. When you run the generator, don't override the model and don't run the migration and you'll be fine.

You might want to try the complete installation out in a separate rails application and see what you need to change in your own application, like rename any columns to what Devise expects. You can remove your own controllers too.

Devise is really flexible. If you want to change the behavior of the controllers, you can inherit from the original ones and instruct the router to use your own. Devise has many hook methods you can override in your own subclasses.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜