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
- #dynamic_title(title, **options) ⇒ Object
- #tabs_id_for_question(question) ⇒ Object
- #tabs_id_for_question_answer_option(question, answer_option) ⇒ Object
- #tabs_id_for_question_matrix_row(question, matrix_row) ⇒ Object
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, **) data = { "max-length" => [:max_length], "omission" => [:omission], "placeholder" => [:placeholder], "locale" => I18n.locale } content_tag :span, class: [:class], data: data do truncate translated_attribute(title), length: [:max_length], omission: [: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 |