fb2b4d8a8a
chore: fix api test conventions chore: rubocop -A spec/ chore: more rubocop -A fix failing test rubocop fixes removes helper methods that are in my opinion dead code more rubocop fixes rubocop -a --auto-gen-config
16 lines
545 B
Ruby
16 lines
545 B
Ruby
class Foodcoop::OrdergroupsController < ApplicationController
|
|
def index
|
|
@ordergroups = Ordergroup.undeleted.sort_by_param(params['sort'])
|
|
|
|
@ordergroups = @ordergroups.where('name LIKE ?', "%#{params[:name]}%") if params[:name].present? # Search by name
|
|
|
|
@ordergroups = @ordergroups.active if params[:only_active] # Select only active groups
|
|
|
|
@ordergroups = @ordergroups.page(params[:page]).per(@per_page)
|
|
|
|
respond_to do |format|
|
|
format.html # index.html.erb
|
|
format.js { render layout: false }
|
|
end
|
|
end
|
|
end
|