Method: Chaltron::UsersController#destroy

Defined in:
app/controllers/chaltron/users_controller.rb

#destroyObject



72
73
74
75
76
77
78
79
80
81
# File 'app/controllers/chaltron/users_controller.rb', line 72

def destroy
  if current_user == @user
    redirect_to({ action: :index }, alert: I18n.t('chaltron.users.cannot_self_destroy'))
  else
    info I18n.t('chaltron.logs.users.destroyed',
      current: current_user.display_name, user: @user.display_name)
    @user.destroy
    respond_with(@user)
  end
end