Class: GovukPublishingComponents::Presenters::StepByStepNavHelper

Inherits:
Object
  • Object
show all
Includes:
ActionView::Context, ActionView::Helpers
Defined in:
lib/govuk_publishing_components/presenters/step_by_step_nav_helper.rb

Overview

Only used by the step by step component

Instance Method Summary collapse

Instance Method Details

#generate_step_nav_id(step_title) ⇒ Object



21
22
23
# File 'lib/govuk_publishing_components/presenters/step_by_step_nav_helper.rb', line 21

def generate_step_nav_id(step_title)
  step_title.parameterize
end

#render_step_nav_element(element, options) ⇒ Object



9
10
11
12
13
14
15
16
17
18
19
# File 'lib/govuk_publishing_components/presenters/step_by_step_nav_helper.rb', line 9

def render_step_nav_element(element, options)
  @options = options
  @link_index = options[:link_index]

  case element[:type]
  when "paragraph"
    paragraph(element[:text])
  when "list"
    list(element)
  end
end