Authentication with Devise and cancancan in Rails 4.2

I have just finished implementing role based authentication in a Rails app I’m working on. I accomplished this using two popular Ruby gems: Devise and Cancancan.

It occurred to me that there are not many tutorials available on this subject (most refer to an older version of Rails and/or the now defunct Cancan library), so I took a moment to summarize my findings in a step by step guide. You can find it here: http://hibbard.eu/authentication-with-devise-and-cancancan-in-rails-4-2/

First and foremost, I hope that it is useful for others trying to accomplish similar tasks. I would additionally be grateful for any feedback on how I could improve or refine this tutorial.

2 Likes