Module: CCS::FrontendHelpers::GovUKFrontend::Breadcrumbs

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

Overview

GOV.UK Breadcrumbs

This helper is used for generating the breadcrumbs component from the GDS - Components - Breadcrumbs

Instance Method Summary collapse

Instance Method Details

#govuk_breadcrumbs(breadcrumb_links, **options) ⇒ ActiveSupport::SafeBuffer

Generates the HTML for the GOV.UK breadcrumbs component

Parameters:

  • breadcrumb_links (Array<Hash>)

    An array of links for the breadcrumbs list. See Link#initialize for details of the items in the array.

  • options (Hash)

    options that will be used in customising the HTML

Options Hash (**options):

  • :classes (String)

    additional CSS classes for the breadcrumbs HTML

  • :collapse_on_mobile (Boolean)

    indicates if it is to colapse breadcrumbs on mobile

  • :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/breadcrumbs.rb', line 22

def govuk_breadcrumbs(breadcrumb_links, **options)
  Components::GovUK::Breadcrumbs.new(context: self, breadcrumb_links: breadcrumb_links, **options).render
end