Method: CCS::Components::GovUK::TaskList::Item::Title#render

Defined in:
lib/ccs/components/govuk/task_list/item/title.rb

#renderActiveSupport::SafeBuffer

Generates the HTML for the GOV.UK Task list item title

Returns:

  • (ActiveSupport::SafeBuffer)


42
43
44
45
46
47
48
# File 'lib/ccs/components/govuk/task_list/item/title.rb', line 42

def render
  if href
    link_to(text, href, class: "govuk-link govuk-task-list__link #{@options[:attributes][:class]}".rstrip, aria: { describedby: @options[:attributes][:aria][:describedby] })
  else
    tag.div(text, class: @options[:attributes][:class])
  end
end