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
# 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('govuk-skip-link')

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

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