Class: UsersController

Inherits:
ApplicationController
  • Object
show all
Includes:
Pundit
Defined in:
lib/kowl/templates/app/controllers/users_controller.rb

Instance Method Summary collapse

Instance Method Details

#impersonateObject



6
7
8
9
10
11
# File 'lib/kowl/templates/app/controllers/users_controller.rb', line 6

def impersonate
  user = User.find(params[:id])
  authorize user
  impersonate_user(user)
  redirect_to root_path
end

#stop_impersonatingObject



13
14
15
16
# File 'lib/kowl/templates/app/controllers/users_controller.rb', line 13

def stop_impersonating
  stop_impersonating_user
  redirect_to(request.referer || root_path)
end