Sha256: 9fc80f885812ac833b83135dc17272f6e062370884bac09f351e43f4b4e44990

Contents?: true

Size: 662 Bytes

Versions: 13

Compression:

Stored size: 662 Bytes

Contents

# frozen_string_literal: true

module Decidim
  module Design
    class ApplicationController < ::DecidimController
      include NeedsOrganization

      helper Decidim::MetaTagsHelper

      helper_method :path_items

      def path_items(path)
        files = Dir.glob("#{gem_path}/app/views/decidim/design/#{path}/*.html.erb")

        files.map do |file|
          name = File.basename(file, ".html.erb")
          { name:, path: send("#{path.singularize}_path", name) }
        end
      end

      private

      def gem_path
        @gem_path ||= Bundler.load.specs.find { |spec| spec.name == "decidim-design" }.full_gem_path
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
decidim-design-0.29.1 app/controllers/decidim/design/application_controller.rb
decidim-design-0.28.4 app/controllers/decidim/design/application_controller.rb
decidim-design-0.29.0 app/controllers/decidim/design/application_controller.rb
decidim-design-0.28.3 app/controllers/decidim/design/application_controller.rb
decidim-design-0.29.0.rc4 app/controllers/decidim/design/application_controller.rb
decidim-design-0.29.0.rc3 app/controllers/decidim/design/application_controller.rb
decidim-design-0.29.0.rc2 app/controllers/decidim/design/application_controller.rb
decidim-design-0.29.0.rc1 app/controllers/decidim/design/application_controller.rb
decidim-design-0.28.2 app/controllers/decidim/design/application_controller.rb
decidim-design-0.28.1 app/controllers/decidim/design/application_controller.rb
decidim-design-0.28.0 app/controllers/decidim/design/application_controller.rb
decidim-design-0.28.0.rc5 app/controllers/decidim/design/application_controller.rb
decidim-design-0.28.0.rc4 app/controllers/decidim/design/application_controller.rb