Petya petrov
Petya petrov

Reputation: 2213

Admin views page as user

Hello i need following function. Admin needs to be able "logged" as user. View all pages as user, but still have an admin features. I more than sure that there is exist ready-made solutions for this. If not, please give me advice how to build this and avoid issue when user logged in and admin logged in as this user.

Upvotes: 1

Views: 319

Answers (1)

Dty
Dty

Reputation: 12273

You're talking about authentication and authorization. For authentication the most popular option right now is Devise. For authorization a popular option is CanCan (by Ryan Bates of railscasts fame). These two gems work well together and there's a lot of information out there on how to use them. (see below)

As for your question about an admin logging in as a user, here's a wiki for Devise on how to do that.

Screencast on using Devise

Screencast on using CanCan

Upvotes: 2

Related Questions