Sha256: 90f1fb350e131cb05ee71ba246d85ab09710da3dde05f1b9909f52738d24386b

Contents?: true

Size: 441 Bytes

Versions: 7

Compression:

Stored size: 441 Bytes

Contents

# frozen_string_literal: true

module Decidim
  # A Helper to render and link to resources.
  module SearchesHelper
    def searchable_resource_human_name(resource)
      resource.model_name.human.pluralize
    end

    def searchable_resources_as_options(all_label)
      [["", all_label]] + Decidim::Searchable.searchable_resources.values.collect do |r|
        [r.name, searchable_resource_human_name(r)]
      end.sort
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
decidim-core-0.13.1 app/helpers/decidim/searches_helper.rb
decidim-core-0.12.2 app/helpers/decidim/searches_helper.rb
decidim-core-0.13.0 app/helpers/decidim/searches_helper.rb
decidim-core-0.12.1 app/helpers/decidim/searches_helper.rb
decidim-core-0.13.0.pre1 app/helpers/decidim/searches_helper.rb
decidim-core-0.12.0 app/helpers/decidim/searches_helper.rb
decidim-core-0.12.0.pre app/helpers/decidim/searches_helper.rb