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

28 lines
782 B
Plaintext
Raw Normal View History

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