Class: CCS::Components::GovUK::BackLink
- Defined in:
- lib/ccs/components/govuk/back_link.rb
Overview
GOV.UK Back Link
This is used to generate the back link component from the GDS - Components - Back link
Constant Summary collapse
- DEFAULT_ATTRIBUTES =
The default attributes for the back link
{ class: 'govuk-back-link' }.freeze
Instance Method Summary collapse
-
#initialize(text:, href:, **options) ⇒ BackLink
constructor
A new instance of BackLink.
-
#render ⇒ ActiveSupport::SafeBuffer
Generates the HTML for the GOV.UK Back link component.
Constructor Details
#initialize(text:, href:, **options) ⇒ BackLink
Returns a new instance of BackLink.
30 31 32 33 34 35 |
# File 'lib/ccs/components/govuk/back_link.rb', line 30 def initialize(text:, href:, **) super(**) @text = text @href = href end |
Instance Method Details
#render ⇒ ActiveSupport::SafeBuffer
Generates the HTML for the GOV.UK Back link component
41 42 43 |
# File 'lib/ccs/components/govuk/back_link.rb', line 41 def render link_to(text, href, **[:attributes]) end |