Class: Admin::UsersController

Inherits:
ApplicationController show all
Defined in:
lib/kowl/templates/app/controllers/admin/users_controller.rb

Instance Method Summary collapse

Methods inherited from ApplicationController

#ensure_admin!

Instance Method Details

#orderObject

Used for setting a default sort for the users

> github.com/thoughtbot/administrate/issues/442



30
31
32
33
34
35
# File 'lib/kowl/templates/app/controllers/admin/users_controller.rb', line 30

def order
  @order ||= Administrate::Order.new(
    params.fetch(resource_name, {}).fetch(:order, 'created_at'),
    params.fetch(resource_name, {}).fetch(:direction, 'desc')
  )
end