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

#indexObject

GET /requests



5
6
7
8
9
10
11
12
13
14
# File 'app/controllers/users_controller.rb', line 5

def index
  if current_user.superuser || current_user.sysadmin || current_user.trainer
    @users = User.order("family_name ASC NULLS LAST")
    add_breadcrumb("Current Users")
  else
    error_message = "You do not have access to this page."
    flash[:notice] = error_message
    redirect_to dashboard_path
  end
end