app/controllers/admin/users_controller.rb
# allow an admin to sign-in as any other user
allow an admin to sign-in as any other user
allow an admin to sign - in as any other user
def switch_to_user
    if current_user != @user
      old_user = current_user
      bypass_sign_in(@user)
      session[:original_admin_user_id] = old_user.id
    end
    redirect_to agents_path
  end
def switch_to_user if current_user != @user old_user = current_user bypass_sign_in ( @user ) session [ :original_admin_user_id ] = old_user . id end redirect_to agents_path end
allow an admin to sign-in as any other user
allow an admin to sign - in as any other user