Class: System::Admin::Instance::UsersController

Inherits:
Controller
  • Object
show all
Defined in:
app/controllers/system/admin/instance/users_controller.rb

Instance Method Summary collapse

Instance Method Details

#destroyObject


20
21
22
23
24
25
26
# File 'app/controllers/system/admin/instance/users_controller.rb', line 20

def destroy
  if @instance_user.destroy
    redirect_to admin_instance_users_path, success: t('.success', user: @instance_user.user.name)
  else
    redirect_to admin_instance_users_path, danger: @instance_user.errors.full_messages.to_sentence
  end
end

#indexObject


7
8
9
10
# File 'app/controllers/system/admin/instance/users_controller.rb', line 7

def index
  load_instance_users
  load_counts
end

#updateObject


12
13
14
15
16
17
18
# File 'app/controllers/system/admin/instance/users_controller.rb', line 12

def update
  if @instance_user.update_attributes(instance_user_params)
    flash.now[:success] = t('.success', user: @instance_user.user.name)
  else
    flash.now[:danger] = @instance_user.errors.full_messages.to_sentence
  end
end