Module: Decidim::SearchesHelper
- Included in:
- CardMCell
- Defined in:
- app/helpers/decidim/searches_helper.rb
Overview
A Helper to render and link to searchables.
Instance Method Summary collapse
- #searchable_resource_human_name(resource, count: 1) ⇒ Object
- #searchable_resources_as_options(all_label) ⇒ Object
Instance Method Details
#searchable_resource_human_name(resource, count: 1) ⇒ Object
7 8 9 |
# File 'app/helpers/decidim/searches_helper.rb', line 7 def searchable_resource_human_name(resource, count: 1) resource.model_name.human(count: count) end |
#searchable_resources_as_options(all_label) ⇒ Object
11 12 13 14 15 |
# File 'app/helpers/decidim/searches_helper.rb', line 11 def (all_label) [["", all_label]] + Decidim::Searchable.searchable_resources.values.collect do |r| [r.name, searchable_resource_human_name(r, count: 2)] end.sort end |