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 << content_tag(:div, li_content.join, class: 'accordion-group')
end.join
if skip_if_empty? && item_container.empty?
''
else
content_tag :div, list_content, {:class => 'accordion', "id" => 'navigation'}
end
end
|