Module: MetadataPresenter::ApplicationHelper
- Defined in:
- app/helpers/metadata_presenter/application_helper.rb
Instance Method Summary collapse
-
#m(text) ⇒ Object
(also: #to_markdown)
Renders markdown given a text.
- #main_h1(component) ⇒ Object
Instance Method Details
#m(text) ⇒ Object Also known as: to_markdown
Renders markdown given a text.
22 23 24 |
# File 'app/helpers/metadata_presenter/application_helper.rb', line 22 def m(text) (Kramdown::Document.new(text).to_html).html_safe end |
#main_h1(component) ⇒ Object
3 4 5 6 7 8 9 10 11 12 13 14 15 |
# File 'app/helpers/metadata_presenter/application_helper.rb', line 3 def main_h1(component) if component.legend.present? content_tag(:legend, class: 'govuk-fieldset__legend govuk-fieldset__legend--l') do content_tag(:h1, class: 'govuk-heading-xl') do component.legend end end else content_tag(:h1, class: 'govuk-heading-xl') do component.label end end end |