Module: CCS::FrontendHelpers::GovUKFrontend::Pagination

Included in:
CCS::FrontendHelpers::GovUKFrontend
Defined in:
lib/ccs/frontend_helpers/govuk_frontend/pagination.rb

Overview

GOV.UK Pagination

This helper is used for generating the pagination component from the GDS - Components - Pagination

Instance Method Summary collapse

Instance Method Details

#govuk_pagination(**options) ⇒ ActiveSupport::SafeBuffer

Generates the HTML for the GOV.UK Pagination component

Parameters:

  • pagination_previous (Hash)

    attributes for the pagination previous, see Previous#initialize for more details.

  • pagination_items (Array<Hash>)

    An array of options for the pagination items. See Item::Tag#initialize and Item::Form#initialize for details of the items in the array.

  • pagination_next (Hash)

    attributes for the pagination next, see Next#initialize for more details.

  • options (Hash)

    options that will be used in customising the HTML

Options Hash (**options):

  • :classes (String)

    additional CSS classes for the pagination HTML

  • :form (ActionView::Helpers::FormBuilder)

    form builder used to create pagination buttons

  • :attributes (Hash)

    any additional attributes that will added as part of the HTML

Returns:

  • (ActiveSupport::SafeBuffer)


22
23
24
# File 'lib/ccs/frontend_helpers/govuk_frontend/pagination.rb', line 22

def govuk_pagination(**options)
  Components::GovUK::Pagination.new(context: self, **options).render
end