2014-11-25 13:09:55 +01:00
<h1>All products</h1>
2014-12-09 14:42:50 +01:00
<%= render partial: 'flash' %>
2014-11-25 13:09:55 +01:00
2014-12-10 22:06:36 +01:00
<div role="tabpanel">
<!-- Nav tabs -->
<ul class="nav nav-tabs" role="tablist">
<% @categories.each do |o, i| %>
<li role="presentation"<% if i.zero? %> class="active"<% end %>><a href="#<%= o %>" aria-controls="<%= o %>" role="tab" data-toggle="tab"><%= o.titleize %></a></li>
<% end %>
2014-12-11 12:41:53 +01:00
<li role="presentation"><a href="#all" role="tab" data-toggle="tab">All</a></li>
2014-12-10 22:06:36 +01:00
</ul>
<!-- Tab panes -->
<div class="tab-content">
<br />
<% @categories.each do |o, i| %>
<div role="tabpanel" class="tab-pane<% if i.zero? %> active<% end %>" id="<%= o %>">
<%= render @products.where(category: i) %>
</div>
<% end %>
2014-12-11 12:41:53 +01:00
<div role="tabpanel" class="tab-pane" id="all">
<%= render @products %>
</div>
2014-12-09 14:39:27 +01:00
</div>
2014-12-10 22:06:36 +01:00
2014-12-09 14:39:27 +01:00
</div>
2014-12-10 22:06:36 +01:00