Commit 39df53ff authored by Bob Van Landuyt's avatar Bob Van Landuyt
Browse files

Use the default sort set by the `Sortable` concern

parent cb4a09bb302e
class Dashboard::GroupsController < Dashboard::ApplicationController
def index
@sort = params[:sort] || 'id_desc'
@groups =, all_available: false).execute
# Only show root groups if no parent-id is given
@groups = @groups.where(parent_id: params[:parent_id])
@groups =[:filter]) if params[:filter].present?
@groups = @groups.includes(:route)
@groups = @groups.sort(@sort)
@groups = @groups.sort(@sort = params[:sort])
@groups =[:page])
respond_to do |format|
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment