Module: CCS::FrontendHelpers::GovUKFrontend::ExitThisPage

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

Overview

GOV.UK Exit this page

This is used to generate the exit this page component from the GDS - Components - Exit this page

Instance Method Summary collapse

Instance Method Details

#govuk_exit_this_page(text = nil, redirect_url = nil, **options) ⇒ ActiveSupport::SafeBuffer

Generates the HTML for the GOV.UK Exit this page component

Parameters:

  • text (String) (defaults to: nil)

    the text for the exit this page

  • redirect_url (String) (defaults to: nil)

    the href for the exit this page

  • options (Hash)

    options that will be used in customising the HTML

Options Hash (**options):

  • :classes (String)

    additional CSS classes for the exit this page HTML

  • :activated_text (String)

    Text announced by screen readers when Exit this Page has been activated via the keyboard shortcut. Defaults to “Loading.”

  • :timed_out_text (String)

    Text announced by screen readers when the keyboard shortcut has timed out without successful activation. Defaults to “Exit this page expired.”

  • :press_two_more_times_text (String)

    Text announced by screen readers when the user must press Shift two more times to activate the button. Defaults to “Shift, press 2 more times to exit.”

  • :press_one_more_time_text (String)

    Text announced by screen readers when the user must press Shift one more time to activate the button. Defaults to “Shift, press 1 more time to exit.”

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

def govuk_exit_this_page(text = nil, redirect_url = nil, **options)
  Components::GovUK::ExitThisPage.new(context: self, text: text, redirect_url: redirect_url, **options).render
end