From 078f03093f23f6979f6a6065809a84fe0859ea04 Mon Sep 17 00:00:00 2001 From: cedricnjanga Date: Fri, 3 Nov 2017 10:09:13 +0100 Subject: Refs #4838 Add pagination to CCS#index --- app/controllers/compliance_control_sets_controller.rb | 2 +- app/views/compliance_control_sets/index.html.slim | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/app/controllers/compliance_control_sets_controller.rb b/app/controllers/compliance_control_sets_controller.rb index b45e85d49..956f26112 100644 --- a/app/controllers/compliance_control_sets_controller.rb +++ b/app/controllers/compliance_control_sets_controller.rb @@ -9,7 +9,7 @@ class ComplianceControlSetsController < InheritedResources::Base scope = self.ransack_period_range(scope: @compliance_control_sets, error_message: t('imports.filters.error_period_filter'), query: :where_updated_at_between) @q_for_form = scope.ransack(params[:q]) format.html { - @compliance_control_sets = decorate_compliance_control_sets(@q_for_form.result) + @compliance_control_sets = decorate_compliance_control_sets(@q_for_form.result.paginate(page: params[:page], per_page: 30)) } end end diff --git a/app/views/compliance_control_sets/index.html.slim b/app/views/compliance_control_sets/index.html.slim index 02d40c813..8ea9250b3 100644 --- a/app/views/compliance_control_sets/index.html.slim +++ b/app/views/compliance_control_sets/index.html.slim @@ -48,6 +48,8 @@ sortable: true, links: [:show], cls: 'table has-filter has-search' + + = new_pagination @compliance_control_sets, 'pull-right' - unless @compliance_control_sets.any? .row.mt-xs .col-lg-12 -- cgit v1.2.3