Devise
Follow the railcast (209-introducing devise) at the following link while for the initial part( Ex installation) there is slight difference.
Run the following instead of railscast mention way.
rails generate devise:install
http://railscasts.com/episodes/209-introducing-devise
For customization
http://railscasts.com/episodes/210-customizing-devise
Run the following instead of railscast mention way.
rails generate devise:views
cancan
Start with tutorial at
https://github.com/ryanb/cancan
refer at
follow at
http://railscasts.com/episodes/192-authorization-with-cancan?
In the ability class used the following code by adding “role” field in the User database
if user.role==’admin’
can :manage, :all
end