Sha256: 8db376bb1e16e121dcbdbecca268aa74062d2b5ae6dd13e0727ea3737d35b2a6

Contents?: true

Size: 612 Bytes

Versions: 16

Compression:

Stored size: 612 Bytes

Contents

# frozen_string_literal: true

module Decidim
  module Admin
    # This class contains helpers needed to format ParticipatoryProcesses
    # in order to use them in select forms.
    #
    module ProcessesForSelectHelper
      # Public: A formatted collection of ParticipatoryProcesses to be used
      # in forms.
      #
      # Returns an Array.
      def processes_for_select
        @processes_for_select ||= current_organization.participatory_processes.map do |process|
          [
            translated_attribute(process.title),
            process.id
          ]
        end
      end
    end
  end
end

Version data entries

16 entries across 16 versions & 2 rubygems

Version Path
decidim-admin-0.4.3 app/helpers/decidim/admin/processes_for_select_helper.rb
decidim-admin-0.4.2 app/helpers/decidim/admin/processes_for_select_helper.rb
decidim-admin-0.4.1 app/helpers/decidim/admin/processes_for_select_helper.rb
decidim-0.4.3 decidim-admin/app/helpers/decidim/admin/processes_for_select_helper.rb
decidim-0.4.2 decidim-admin/app/helpers/decidim/admin/processes_for_select_helper.rb
decidim-0.4.1 decidim-admin/app/helpers/decidim/admin/processes_for_select_helper.rb
decidim-admin-0.4.0 app/helpers/decidim/admin/processes_for_select_helper.rb
decidim-0.4.0 decidim-admin/app/helpers/decidim/admin/processes_for_select_helper.rb
decidim-admin-0.3.2 app/helpers/decidim/admin/processes_for_select_helper.rb
decidim-0.3.2 decidim-admin/app/helpers/decidim/admin/processes_for_select_helper.rb
decidim-admin-0.3.1 app/helpers/decidim/admin/processes_for_select_helper.rb
decidim-0.3.1 decidim-admin/app/helpers/decidim/admin/processes_for_select_helper.rb
decidim-admin-0.3.0 app/helpers/decidim/admin/processes_for_select_helper.rb
decidim-0.3.0 decidim-admin/app/helpers/decidim/admin/processes_for_select_helper.rb
decidim-admin-0.2.0 app/helpers/decidim/admin/processes_for_select_helper.rb
decidim-0.2.0 decidim-admin/app/helpers/decidim/admin/processes_for_select_helper.rb