Module: ConstructorPages::TemplatesHelper

Includes:
TreeviewHelper
Defined in:
app/helpers/constructor_pages/templates_helper.rb

Instance Method Summary collapse

Methods included from TreeviewHelper

#render_tree

Instance Method Details

#for_select(roots) ⇒ Object



5
6
7
8
9
10
11
# File 'app/helpers/constructor_pages/templates_helper.rb', line 5

def for_select(roots)
  result = []
  roots.each do |r|
    r.self_and_descendants.each {|i| result.push(["#{'--'*i.level} #{i.name}", i.id])}
  end
  result
end