graphmeter
graphmeter

Reputation: 1125

Authentication from scratch to Devise

I would like to move from an authentication from scratch that I have built following the Ruby on Rails tutorial (Michael Hartl) to using Devise together with CanCan and Rolify. What is the best approach for doing this? Should I delete the user model already in place and let Devise generate one? Do I have to modify the migration files? How should I go about the tests that I have written for the users? Thank you for your help.

Upvotes: 0

Views: 396

Answers (1)

davidrac
davidrac

Reputation: 10738

I'd start by disabling the authentication checks of your solution and then add devise. Devise can work with your pre-existing model, so you don't need to delete it. Also the migrations that you have created so far are fine, you'll just need to run devise's migration as well. You'll have to take care of the devise changes in your tests, however this is very simple and well documented. It's best to go through devise's excellent wiki to get the details. Good Luck!

Upvotes: 1

Related Questions