Class: Comable::Admin::UsersController

Inherits:
ApplicationController show all
Includes:
PermittedAttributes
Defined in:
app/controllers/comable/admin/users_controller.rb

Instance Method Summary collapse

Methods inherited from ApplicationController

#current_ability, #respond_to_export_with

Instance Method Details

#editObject



18
19
# File 'app/controllers/comable/admin/users_controller.rb', line 18

def edit
end

#indexObject



10
11
12
13
# File 'app/controllers/comable/admin/users_controller.rb', line 10

def index
  @q = Comable::User.ransack(params[:q])
  @users = @q.result.page(params[:page]).accessible_by(current_ability)
end

#showObject



15
16
# File 'app/controllers/comable/admin/users_controller.rb', line 15

def show
end

#updateObject



21
22
23
24
25
26
27
28
# File 'app/controllers/comable/admin/users_controller.rb', line 21

def update
  if @user.update_attributes(user_params)
    redirect_to comable.admin_user_path(@user), notice: Comable.t('successful')
  else
    flash.now[:alert] = Comable.t('failure')
    render :edit
  end
end