Module: Decidim::Forms::Admin::ApplicationHelper

Defined in:
app/helpers/decidim/forms/admin/application_helper.rb

Overview

Custom helpers, scoped to the forms engine.

Instance Method Summary collapse

Instance Method Details

#dynamic_title(title, **options) ⇒ Object



21
22
23
24
25
26
27
28
29
30
31
# File 'app/helpers/decidim/forms/admin/application_helper.rb', line 21

def dynamic_title(title, **options)
  data = {
    "max-length" => options[:max_length],
    "omission" => options[:omission],
    "placeholder" => options[:placeholder],
    "locale" => I18n.locale
  }
   :span, class: options[:class], data: data do
    truncate translated_attribute(title), length: options[:max_length], omission: options[:omission]
  end
end

#tabs_id_for_question(question) ⇒ Object



9
10
11
# File 'app/helpers/decidim/forms/admin/application_helper.rb', line 9

def tabs_id_for_question(question)
  "questionnaire_question_#{question.to_param}"
end

#tabs_id_for_question_answer_option(question, answer_option) ⇒ Object



13
14
15
# File 'app/helpers/decidim/forms/admin/application_helper.rb', line 13

def tabs_id_for_question_answer_option(question, answer_option)
  "questionnaire_question_#{question.to_param}_answer_option_#{answer_option.to_param}"
end

#tabs_id_for_question_matrix_row(question, matrix_row) ⇒ Object



17
18
19
# File 'app/helpers/decidim/forms/admin/application_helper.rb', line 17

def tabs_id_for_question_matrix_row(question, matrix_row)
  "questionnaire_question_#{question.to_param}_matrix_row_#{matrix_row.to_param}"
end