Module: CCS::FrontendHelpers::GovUKFrontend::BackLink

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

Overview

GOV.UK Back Link

This helper is used for generating the back link component from the GDS - Components - Back link

Instance Method Summary collapse

Instance Method Details

Generates the HTML for the GOV.UK Back link component

Parameters:

  • text (String)

    the text for the back link

  • href (String)

    the href for the back link

  • options (Hash)

    options that will be used in customising the HTML

Options Hash (**options):

  • :classes (String)

    additional CSS classes for the back link HTML

  • :attributes (Hash) — default: {}

    any additional attributes that will added as part of the HTML

Returns:

  • (ActiveSupport::SafeBuffer)


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

def govuk_back_link(text, href, **options)
  Components::GovUK::BackLink.new(context: self, text: text, href: href, **options).render
end