Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <% parents = [] %>
- <ul>
- <% @categories.each do |category| %>
- <% parents.each do |parent| %>
- <% if !category.is_descendant_of?(parent) %>
- <% active_parents.delete(parent) %>
- </ul></li>
- <% end %>
- <% end %>
- <li>
- <%= category.name %>
- <% if category.leaf? %>
- </li>
- <% else %>
- <% parents << category %>
- <ul>
- <% end %>
- <% end %>
- </ul>
Add Comment
Please, Sign In to add comment