I’m using devise on rails3 and I’d like to implement “su” with it.
To debug my application, it sometimes helps a lot to see exactly what the user who is having the problem is seeing. Therefore I would like to have the possibility (as an admin) to switch to that user without needing to know his password. Just like su on linux systems.
I’ve seen it done for authlogic (http://blog.steveklabnik.com/2010/03/05/writing-a-su-feature-with-authlogic.html).
The final outcome should be, that when I call /admin/su/5 as a User with the role “admin” I should be logged in as the user with id 5.
Any help or pointers into the right direction are creatly appreciated.
From Mike Barinek
Fast user switching with Devise
This sounds like what you’re requesting, and even includes cucumber specs.