Last Updated: February 25, 2016
·
3.499K
· dvilla

Authenticate a controller for two models using devise

Using Devise and the before filter

     before_filter do
if current_admin != nil
 authenticate_admin!        
else
 authenticate_user!
end

Now the controller is authenticated for an admin and a normal and mortal user.