You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
educoder/app/controllers/cooperative/users_controller.rb

21 lines
583 B

class Cooperative::UsersController < Cooperative::BaseController
def index
default_sort('created_on', 'desc')
users = Admins::UserQuery.call(search_params.merge(laboratory_id: current_laboratory.id))
@users = paginate users.includes(user_extension: :school)
end
def for_select
default_sort('created_on', 'desc')
users = Admins::UserQuery.call(search_params)
@users = paginate users.includes(user_extension: :school)
end
private
def search_params
params.permit(:identity, :name, :keyword, :school_name, :sort_by, :sort_direction)
end
end