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:
parent
8f94403ccf
commit
0a6345c60b
14 changed files with 278 additions and 25 deletions
|
|
@ -1,6 +1,6 @@
|
|||
class Foodcoop::OrdergroupsController < ApplicationController
|
||||
def index
|
||||
@ordergroups = Ordergroup.undeleted.order('name')
|
||||
@ordergroups = Ordergroup.undeleted.sort_by_param(params["sort"])
|
||||
|
||||
unless params[:name].blank? # Search by name
|
||||
@ordergroups = @ordergroups.where('name LIKE ?', "%#{params[:name]}%")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue