Class: MrMime::ImpersonationsController

Inherits:
ApplicationController show all
Defined in:
app/controllers/mr_mime/impersonations_controller.rb

Instance Method Summary collapse

Methods included from ImpersonationBehavior

#current_impersonator, #impersonator?, #impersonator_id, included

Instance Method Details

#createObject



5
6
7
8
9
10
11
# File 'app/controllers/mr_mime/impersonations_controller.rb', line 5

def create
  if impersonation.save
    redirect_to after_impersonation_url, notice: 'Impersonation started'
  else
    redirect_to :back, flash: { error: impersonation.error_messages }
  end
end

#destroyObject



13
14
15
16
17
# File 'app/controllers/mr_mime/impersonations_controller.rb', line 13

def destroy
  impersonation.revert

  redirect_to return_to_url, notice: 'Impersonation ended'
end