Module: ConstructorPages::PagesHelper
- Defined in:
- app/helpers/constructor_pages/pages_helper.rb
Instance Method Summary collapse
Instance Method Details
#for_select(roots) ⇒ Object
3 4 5 6 7 8 9 |
# File 'app/helpers/constructor_pages/pages_helper.rb', line 3 def for_select(roots) result = [] roots.each do |r| r.self_and_descendants.each {|i| result.push(["#{'--'*i.level} #{i.name}", i.id, {'data-full_url' => i.full_url}])} end result end |
#templates ⇒ Object
11 12 13 |
# File 'app/helpers/constructor_pages/pages_helper.rb', line 11 def templates Template.all.map{|t| ["#{'--'*t.level} #{t.name}", t.id]} end |