Module: GovukExitThisPageLinkHelper

Defined in:
app/helpers/govuk_exit_this_page_link_helper.rb

Instance Method Summary collapse

Instance Method Details



2
3
4
5
6
7
8
9
10
11
12
13
14
# File 'app/helpers/govuk_exit_this_page_link_helper.rb', line 2

def govuk_exit_this_page_link(
  text: Govuk::Components.config.default_exit_this_page_text,
  href: Govuk::Components.config.default_exit_this_page_redirect_url,
  classes: [],
  **html_attributes,
  &block
)
  link_classes = Array.wrap(classes).append(["#{brand}-skip-link", "#{brand}-js-exit-this-page-skiplink"])

  html_attributes_with_data_module = { data: { module: "#{brand}-skip-link" } }.deep_merge(html_attributes)

  link_to(text, href, class: link_classes, **html_attributes_with_data_module, &block)
end