Module: CamaleonCms::Admin::CategoryHelper
- Included in:
- ApplicationHelper
- Defined in:
- app/helpers/camaleon_cms/admin/category_helper.rb
Overview
encoding: utf-8
Instance Method Summary collapse
-
#cama_category_get_options_html(categories, level = 0) ⇒ Object
build an array multiple with category items prefixed with - for each level categories: collection of categories level: internal iterator control.
Instance Method Details
#cama_category_get_options_html(categories, level = 0) ⇒ Object
build an array multiple with category items prefixed with - for each level categories: collection of categories level: internal iterator control
15 16 17 18 19 20 21 22 23 |
# File 'app/helpers/camaleon_cms/admin/category_helper.rb', line 15 def (categories, level = 0) = [] categories.all.decorate.each do |category| << [("—"*level) + category.the_title, category.id] unless @category.id == category.id children = category.children += (children, level + 1) if children.size > 0 end end |