Module: Helena::ApplicationHelper

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

Instance Method Summary collapse

Instance Method Details

#question_label(question, options = {}) ⇒ Object



8
9
10
11
12
# File 'app/helpers/helena/application_helper.rb', line 8

def question_label(question, options = {})
  ((options[:dummy] ? :span : :label), class: :label, for: "question_#{question.code}") do
    raw(question.question_text) + (requeired_note if question.required?)
  end
end

#requeired_noteObject



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

def requeired_note
  (:span, t('helena.shared.required_indicator'), aria: { hidden: true }) +
    (:span, t('helena.shared.sr_required_indicator'), class: 'sr-only')
end

#title(page_title) ⇒ Object

Allows to set the header title within the text i.e ‘h1 = title ’This will be also shown in the title tag’‘ Do not forgot to set `content_for(:title)` within the title tag in the head.



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

def title(page_title)
  content_for(:title, page_title)
  page_title
end