Make columns of user and ordergroup lists sortable

This commit implements the sort functionality for the user lists (by name, email, last_activity) and ordergroup lists (by name).
It is a first attempt addressing issue #560.
This commit is contained in:
Harald Reingruber 2022-05-27 17:06:25 +02:00 committed by GitHub
parent 8f94403ccf
commit 0a6345c60b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 278 additions and 25 deletions

View file

@ -2,7 +2,7 @@ class Admin::OrdergroupsController < Admin::BaseController
inherit_resources
def index
@ordergroups = Ordergroup.undeleted.order('name ASC')
@ordergroups = Ordergroup.undeleted.sort_by_param(params["sort"])
if request.format.csv?
send_data OrdergroupsCsv.new(@ordergroups).to_csv, filename: 'ordergroups.csv', type: 'text/csv'