tap/app/views/products/index.html.erb

28 lines
782 B
Text
Raw Normal View History

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">
2014-12-12 13:41:40 +01:00
<li role="presentation" class="active"><a href="#all" role="tab" data-toggle="tab">All</a></li>
2014-12-10 22:06:36 +01:00
<% @categories.each do |o, i| %>
2014-12-12 13:41:40 +01:00
<li role="presentation"><a href="#<%= o %>" aria-controls="<%= o %>" role="tab" data-toggle="tab"><%= o.titleize %></a></li>
2014-12-10 22:06:36 +01:00
<% end %>
</ul>
<!-- Tab panes -->
<div class="tab-content">
<br />
2014-12-12 13:41:40 +01:00
<div role="tabpanel" class="tab-pane active" id="all">
<%= render @products %>
</div>
2014-12-10 22:06:36 +01:00
<% @categories.each do |o, i| %>
2014-12-12 13:41:40 +01:00
<div role="tabpanel" class="tab-pane" id="<%= o %>">
2014-12-10 22:06:36 +01:00
<%= render @products.where(category: i) %>
</div>
<% end %>
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