Module: Decidim::Accountability::BreadcrumbHelper
- Defined in:
- app/helpers/decidim/accountability/breadcrumb_helper.rb
Overview
Helpers needed to render the navigation breadcrumbs in results.
Instance Method Summary collapse
Instance Method Details
#parent_taxonomies(taxonomy) ⇒ Object
14 15 16 17 18 |
# File 'app/helpers/decidim/accountability/breadcrumb_helper.rb', line 14 def parent_taxonomies(taxonomy) return [] if taxonomy&.parent.blank? || taxonomy&.parent&.root? [*parent_taxonomies(taxonomy.parent), taxonomy.parent] end |
#taxonomies_hierarchy ⇒ Object
20 21 22 |
# File 'app/helpers/decidim/accountability/breadcrumb_helper.rb', line 20 def taxonomies_hierarchy parent_taxonomies(taxonomy) end |
#taxonomy ⇒ Object
8 9 10 11 12 |
# File 'app/helpers/decidim/accountability/breadcrumb_helper.rb', line 8 def taxonomy return if (taxonomy_id = params.dig(:filter, :taxonomies_part_of_contains)).blank? @taxonomy ||= current_organization.taxonomies.find(taxonomy_id.is_a?(Array) ? taxonomy_id.first : taxonomy_id) end |