Sha256: f0458e218b09d90e235a660d8495ffed79853713baf77ee97cce3896e8f9bdce
Contents?: true
Size: 601 Bytes
Versions: 7
Compression:
Stored size: 601 Bytes
Contents
# frozen_string_literal: true module Decidim # A Helper to render and link to searchables. module SearchesHelper # @param count: (optional) the number of resources so that the I18n backend can decide to translate into singluar or plural form. def searchable_resource_human_name(resource, count: 1) resource.model_name.human(count: count) 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, count: 2)] end.sort end end end
Version data entries
7 entries across 7 versions & 1 rubygems