Module: Locomotive::Shared::PagesHelper

Defined in:
app/helpers/locomotive/shared/pages_helper.rb

Defined Under Namespace

Classes: Node

Instance Method Summary collapse

Instance Method Details

#render_pagesObject



5
6
7
8
9
10
# File 'app/helpers/locomotive/shared/pages_helper.rb', line 5

def render_pages
  tree  = Locomotive::PageService.new(current_site).build_tree
  nodes = tree.map { |page, children| Node.new(page, children, controller) }

  render 'locomotive/shared/sidebar/pages', nodes: nodes, root: tree.first.first
end