Class: ConteRailsTemplate::NavigationRenderer

Inherits:
SimpleNavigation::Renderer::Base
  • Object
show all
Defined in:
lib/navigation_renderer.rb

Instance Method Summary collapse

Instance Method Details

#render(item_container) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/navigation_renderer.rb', line 3

def render(item_container)
  list_content = item_container.items.inject([]) do |list, item|
    li_content = []
    li_content << tag_for(item)
    if include_sub_navigation?(item)
      li_content << render_sub_navigation_for(item)
    end
    list << (:div, li_content.join, class: 'accordion-group')
  end.join
  if skip_if_empty? && item_container.empty?
    ''
  else  
     :div, list_content, {:class => 'accordion', "id" => 'navigation'}
  end
end