Class: SimplerNavigation::Renderers::List
- Defined in:
- lib/simpler_navigation/renderers/list.rb
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
Methods inherited from Base
Constructor Details
This class inherits a constructor from SimplerNavigation::Renderers::Base
Instance Method Details
#render ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/simpler_navigation/renderers/list.rb', line 6 def render return "" if @item.nil? list = [] @item.children.each_value do |item| next unless show?(item) li_content = link_tag(item) if (item) li_content << List.new(@context, item, @options).render end if @options[:render_content_partials] && item.[:content_partial] li_content << @context.render(partial: item.[:content_partial]) end list << content_tag(:li, li_content, (item)) end content_tag(:ul, safe_join(list), @options[:attributes]) end |