Class: NavigatorRails::Decorators::Submenu

Inherits:
Object
  • Object
show all
Includes:
Generic
Defined in:
lib/navigator_rails/decorators/submenu.rb

Instance Attribute Summary

Attributes included from Generic

#type

Instance Method Summary collapse

Methods included from Generic

#child_count, #children, #children_except, #children_of, #draw, #draw_children, #has_visible_children, included, #resource

Instance Method Details

#templateObject



5
6
7
8
9
10
11
12
13
14
15
# File 'lib/navigator_rails/decorators/submenu.rb', line 5

def template
  return '' unless has_visible_children
  <<-LINK_DECORATION.strip_heredoc
    <li class="dropdown <%= resource.active %>">
      <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false"><%= resource.content %> <span class="caret"></span></a>
      <ul class="dropdown-menu" role="menu">
        <%= draw_children %>
      </ul>
    </li>
  LINK_DECORATION
end