Module: Decidim::Consultations::Admin::QuestionsHelper

Includes:
TranslationsHelper
Defined in:
app/helpers/decidim/consultations/admin/questions_helper.rb

Overview

Helper for questions controller

Defined Under Namespace

Classes: Option

Instance Method Summary collapse

Instance Method Details

#question_example_slugObject



12
13
14
# File 'app/helpers/decidim/consultations/admin/questions_helper.rb', line 12

def question_example_slug
  "question-#{Time.now.utc.year}-#{Time.now.utc.month}-1"
end

#question_response_groups(question = current_question) ⇒ Object



16
17
18
19
20
21
# File 'app/helpers/decidim/consultations/admin/questions_helper.rb', line 16

def question_response_groups(question = current_question)
  [Option.new("", "-")] +
    question.response_groups.map do |group|
      Option.new(group.id, translated_attribute(group.title))
    end
end