Skip to content

Commit

Permalink
Wrap final link args in a hash
Browse files Browse the repository at this point in the history
Now we've added a keyword argument to the link helper we need to tell
Ruby that the third arg is a hash and not a keyword argument.

This is likely to be a breaking change.
  • Loading branch information
peteryates committed Sep 5, 2022
1 parent 14c405c commit de317d3
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions guide/lib/examples/link_helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,23 @@ def govuk_link_to_normal
end

def govuk_link_to_inverse
%(= govuk_link_to 'An inverse hyperlink', '#', inverse: true)
%(= govuk_link_to('An inverse hyperlink', '#', { inverse: true }))
end

def govuk_link_to_muted
%(= govuk_link_to 'A muted hyperlink', '#', muted: true)
%(= govuk_link_to('A muted hyperlink', '#', { muted: true }))
end

def govuk_link_other_styles
<<~LINKS
p
= govuk_link_to 'A hyperlink without an underline', '#', no_underline: true
= govuk_link_to('A hyperlink without an underline', '#', { no_underline: true })
p
= govuk_link_to 'A hyperlink without a visited state', '#', no_visited_state: true
= govuk_link_to('A hyperlink without a visited state', '#', { no_visited_state: true })
p
= govuk_link_to 'A text-coloured hyperlink', '#', text_colour: true
= govuk_link_to('A text-coloured hyperlink', '#', { text_colour: true })
LINKS
end

Expand All @@ -36,9 +36,9 @@ def govuk_button_link_to_normal
def govuk_button_other_styles
<<~BUTTONS
.govuk-button-group
= govuk_button_link_to 'A disabled button', '#', disabled: true
= govuk_button_link_to 'A secondary button', '#', secondary: true
= govuk_button_link_to 'A warning button', '#', warning: true
= govuk_button_link_to('A disabled button', '#', { disabled: true })
= govuk_button_link_to('A secondary button', '#', { secondary: true })
= govuk_button_link_to('A warning button', '#', { warning: true })
BUTTONS
end

Expand Down

0 comments on commit de317d3

Please sign in to comment.