Module: MetadataPresenter::ApplicationHelper

Defined in:
app/helpers/metadata_presenter/application_helper.rb

Instance Method Summary collapse

Instance Method Details

#default_text(property) ⇒ Object



18
19
20
# File 'app/helpers/metadata_presenter/application_helper.rb', line 18

def default_text(property)
  MetadataPresenter::DefaultText[property]
end

#main_title(component:, tag: :h1, classes: 'govuk-heading-xl') ⇒ Object



3
4
5
6
7
# File 'app/helpers/metadata_presenter/application_helper.rb', line 3

def main_title(component:, tag: :h1, classes: 'govuk-heading-xl')
  (tag, class: classes) do
    component.humanised_title
  end
end

#to_html(text) ⇒ Object

Renders html given markdown.

Examples:

<%=to_html '# Some markdown' %>


14
15
16
# File 'app/helpers/metadata_presenter/application_helper.rb', line 14

def to_html(text)
  Kramdown::Document.new(text).to_html.html_safe
end