2009-08-02 18:12:13 +02:00
|
|
|
class Foodcoop::OrdergroupsController < ApplicationController
|
|
|
|
def index
|
2023-05-12 13:01:12 +02:00
|
|
|
@ordergroups = Ordergroup.undeleted.sort_by_param(params['sort'])
|
2009-08-02 18:12:13 +02:00
|
|
|
|
2023-05-12 13:01:12 +02:00
|
|
|
@ordergroups = @ordergroups.where('name LIKE ?', "%#{params[:name]}%") if params[:name].present? # Search by name
|
2012-10-08 16:20:24 +02:00
|
|
|
|
2023-05-12 13:01:12 +02:00
|
|
|
@ordergroups = @ordergroups.active if params[:only_active] # Select only active groups
|
2012-10-08 16:20:24 +02:00
|
|
|
|
|
|
|
@ordergroups = @ordergroups.page(params[:page]).per(@per_page)
|
2009-08-02 18:12:13 +02:00
|
|
|
|
|
|
|
respond_to do |format|
|
|
|
|
format.html # index.html.erb
|
2023-05-12 13:01:12 +02:00
|
|
|
format.js { render layout: false }
|
2009-08-02 18:12:13 +02:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|