Module: GovukSkipLinkHelper

Defined in:
app/helpers/govuk_skip_link_helper.rb

Instance Method Summary collapse

Instance Method Details



2
3
4
5
6
7
8
9
10
# File 'app/helpers/govuk_skip_link_helper.rb', line 2

def govuk_skip_link(text: 'Skip to main content', href: '#main-content', classes: [], **html_attributes, &block)
  link_classes = Array.wrap(classes).append("#{brand}-skip-link")

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

  return link_to(href, class: link_classes, **html_attributes_with_data_module, &block) if block_given?

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