I want to allow an admin on my app to sign in as any user. I found the following on the devise wiki:
class AdminController < ApplicationController
# Sign in as another user if you are an admin
def become
return unless current_user.is_an_admin?
sign_in(:user, User.find(params[:id]))
redirect_to root_path
end
end
In the view, how do you build a form to post to this?
Thanks