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.
Written by Daniel villa
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Devise
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#