Class: UsersController

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

Instance Method Summary collapse

Methods inherited from ApplicationController

#add_breadcrumb, #after_sign_in_path_for, #breadcrumbs, #new_session_path, #require_admin_user

Instance Method Details

#editObject



15
16
17
18
# File 'app/controllers/users_controller.rb', line 15

def edit
  add_breadcrumb("Edit User")
  @user = User.find(params[:id])
end

#indexObject



6
7
8
# File 'app/controllers/users_controller.rb', line 6

def index
  @users = User.order("uid ASC NULLS LAST").page params[:page]
end

#showObject



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

def show
  add_breadcrumb("User")
  @user = User.find(params[:id])
end

#updateObject



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

def update
  update_user_with_params
  redirect_to user_path(@user)
rescue => ex
  short_message = "Error saving user #{params[:id]}"
  Rails.logger.error "#{short_message}: #{ex.message}"
  Honeybadger.notify "#{short_message}: #{ex.message}"
  flash[:alert] = short_message
  redirect_to user_path(id: params[:id])
end