Module: Decidim::Sortitions::Admin::SortitionsHelper
- Includes:
- TranslationsHelper
- Defined in:
- decidim-sortitions/app/helpers/decidim/sortitions/admin/sortitions_helper.rb
Instance Method Summary collapse
-
#components_options(components) ⇒ Object
Converst a list of components into a list of selectable options.
- #sortition_category(sortition) ⇒ Object
Methods included from TranslationsHelper
empty_translatable, ensure_translatable, multi_translation, translated_in_current_locale?
Methods included from TranslatableAttributes
Instance Method Details
#components_options(components) ⇒ Object
Converst a list of components into a list of selectable options
10 11 12 13 14 |
# File 'decidim-sortitions/app/helpers/decidim/sortitions/admin/sortitions_helper.rb', line 10 def (components) components.map do |f| [translated_attribute(f.name), f.id] end end |
#sortition_category(sortition) ⇒ Object
16 17 18 19 20 |
# File 'decidim-sortitions/app/helpers/decidim/sortitions/admin/sortitions_helper.rb', line 16 def sortition_category(sortition) return translated_attribute sortition.category&.name if sortition.category I18n.t("sortitions.form.all_categories", scope: "decidim.sortitions.admin") end |