I’m working on a function that allows any admin to mimic or impersonate other users. In other words, I want the admin to be able to freely access any user’s personal dashboard. I came across a gem by Engine Yard called User_Impersonate (GitHub - engineyard/user_impersonate: Allow your support staff to impersonate users to see what they see). It looks promising, but is fairly new so I was interested in other alternatives to accomplish this.
I’m also using Devise. As an alternative to the above gem, could I just reconfig the Devise route so that the edit user page is no longer user/edit but something like users/:user_id/edit. If you had to implement something similar, how did you handle it? Thanks!
Hi @realDLee, if I was using Devise and wanted to do that functionality I would definitely look at using the user_impersonate gem, it’s 11 months old and looks like it’s actively maintained, so I wouldn’t consider it that new.
This is a really simple version and once an admin has become another user they would be required to sign out and sign back in again as admin to regain control.
The gem mentioned above looks much better and will give my admin users a much slicker experience.
This is awesome! I’ve been always hacking to impersonate some users and never occured to me to search for a solution like this. The gem user_impersonate2 worked like a charm with devise.
There’s just one issue with me, I have 2 different user models: candidate and recruiter. Wondering if/how I could use this gem for those 2 models. Because from what I saw, it’s only possible to use for one user model.