dbarison
7/5/2014 - 3:01 PM

_menu.html.erb

<% if article.is_childless? %>
  <li><%= link_to article.title, article_path(article) %></li>
<% else %>
  <li class="dropdown">
    <%= link_to '#', class: 'dropdown-toggle', data: { toggle: 'dropdown'} do %>
      <%= article.title %>
      <b class="caret"></b>
    <% end %>
    <ul class="dropdown-menu">
      <%= render partial: 'site/menu', collection: article.children, as: :article %>
    </ul>
  </li>
<% end %>