app/views/lookbook/components/_nav_preview.html.erb in lookbook-0.5.0.beta.2 vs app/views/lookbook/components/_nav_preview.html.erb in lookbook-0.5.0
- old
+ new
@@ -4,8 +4,10 @@
<% examples.each do |example| %>
<%= component "nav_item", item: example, depth: example.hierarchy_depth + 1 %>
<% end %>
<% end %>
<% else %>
- <% example = examples.first %>
- <%= component "nav_item", item: example, depth: example.hierarchy_depth, label: node.label, display: :node %>
+ <% if examples.any? %>
+ <% example = examples.first %>
+ <%= component "nav_item", item: example, depth: example.hierarchy_depth, label: node.label, display: :node %>
+ <% end %>
<% end %>