Sha256: 7fb05ceccc7b82c8285514e6d090dd6883fb253866b124fe5f7454f288055c14

Contents?: true

Size: 633 Bytes

Versions: 49

Compression:

Stored size: 633 Bytes

Contents

# frozen_string_literal: true

module Decidim
  module Consultations
    module Admin
      # Helper for questions controller
      module QuestionsHelper
        include Decidim::TranslationsHelper

        Option = Struct.new(:id, :title)

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

        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
      end
    end
  end
end

Version data entries

49 entries across 49 versions & 1 rubygems

Version Path
decidim-consultations-0.27.9 app/helpers/decidim/consultations/admin/questions_helper.rb
decidim-consultations-0.27.8 app/helpers/decidim/consultations/admin/questions_helper.rb
decidim-consultations-0.27.7 app/helpers/decidim/consultations/admin/questions_helper.rb
decidim-consultations-0.27.6 app/helpers/decidim/consultations/admin/questions_helper.rb
decidim-consultations-0.26.10 app/helpers/decidim/consultations/admin/questions_helper.rb
decidim-consultations-0.26.9 app/helpers/decidim/consultations/admin/questions_helper.rb
decidim-consultations-0.27.5 app/helpers/decidim/consultations/admin/questions_helper.rb
decidim-consultations-0.26.8 app/helpers/decidim/consultations/admin/questions_helper.rb
decidim-consultations-0.27.4 app/helpers/decidim/consultations/admin/questions_helper.rb
decidim-consultations-0.27.3 app/helpers/decidim/consultations/admin/questions_helper.rb
decidim-consultations-0.26.7 app/helpers/decidim/consultations/admin/questions_helper.rb
decidim-consultations-0.26.5 app/helpers/decidim/consultations/admin/questions_helper.rb
decidim-consultations-0.27.2 app/helpers/decidim/consultations/admin/questions_helper.rb
decidim-consultations-0.27.1 app/helpers/decidim/consultations/admin/questions_helper.rb
decidim-consultations-0.26.4 app/helpers/decidim/consultations/admin/questions_helper.rb
decidim-consultations-0.27.0 app/helpers/decidim/consultations/admin/questions_helper.rb
decidim-consultations-0.26.3 app/helpers/decidim/consultations/admin/questions_helper.rb
decidim-consultations-0.27.0.rc2 app/helpers/decidim/consultations/admin/questions_helper.rb
decidim-consultations-0.27.0.rc1 app/helpers/decidim/consultations/admin/questions_helper.rb
decidim-consultations-0.26.2 app/helpers/decidim/consultations/admin/questions_helper.rb