I’m using Rails 3.0.10 and I’m currently using CanCan for determining the different abilities that users have within the application.
I am using Devise for the user authentication itself.
Is there a good way for an admin user to “become” another user temporarily using CanCan? This would be especially useful to become specific users who may be experiencing unique issues pertaining to their account.
So in simple terms, I just want to be able to sign in as any given user to see what they see. Not sure if there is a CanCan or Devise feature out there.
UPDATE
I just came across this:
How-To: Sign in as another user if you are an Admin.
I haven’t tested it yet, but it may be the answer I was looking for!! Feel free to provide some insight if this is the approach you took, or if you have another idea!
I found what I was looking for, and there’s a gem for it!
switch_user
It was really easy to use. I just have to add
gem switch_userto my Gemfile.Then add
<%= switch_user_select %>to my layout. Exactly what I wanted!