From a8bc6aefce236b0ecc231312f9c5f05efce4cf8c Mon Sep 17 00:00:00 2001 From: cedricnjanga Date: Wed, 28 Feb 2018 11:08:16 -0800 Subject: Refs #6056 Add pagination to ComplianceCheckSet#index --- app/controllers/compliance_check_sets_controller.rb | 2 +- app/views/compliance_check_sets/index.html.slim | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'app') diff --git a/app/controllers/compliance_check_sets_controller.rb b/app/controllers/compliance_check_sets_controller.rb index 271598428..62b0e6ba3 100644 --- a/app/controllers/compliance_check_sets_controller.rb +++ b/app/controllers/compliance_check_sets_controller.rb @@ -12,7 +12,7 @@ class ComplianceCheckSetsController < ChouetteController @q_for_form = scope.ransack(params[:q]) format.html { @compliance_check_sets = ComplianceCheckSetDecorator.decorate( - @q_for_form.result.order(created_at: :desc) + @q_for_form.result.order(created_at: :desc).paginate(page: params[:page], per_page: 30) ) } end diff --git a/app/views/compliance_check_sets/index.html.slim b/app/views/compliance_check_sets/index.html.slim index 31ad31e5b..58df2714d 100644 --- a/app/views/compliance_check_sets/index.html.slim +++ b/app/views/compliance_check_sets/index.html.slim @@ -42,6 +42,8 @@ ], sortable: true, cls: 'table has-filter has-search' + + = new_pagination @compliance_check_sets, 'pull-right' - unless @compliance_check_sets.any? .row.mt-xs .col-lg-12 -- cgit v1.2.3