tap/app/views/users/show.html.erb
2015-09-01 17:40:18 +02:00

27 lines
678 B
Text

<%= render partial: 'flash' %>
<div class="row">
<%= render 'sidebar' %>
<div id="user_info" class="col-sm-9">
<% if @orders.any? %>
<h4>Previously ordered</h4>
Total:
<ul>
<li>
<%= @categories.map{|c| pluralize(c.count, c.category)}.to_sentence %>
</li>
</ul>
Specifics:
<%= content_tag :ul do %>
<% @products.each do |p| %>
<%= content_tag :li, pluralize(p.count, p.name) %>
<% end %>
<% end %>
<h4>All orders (<%= @user.orders_count %>)</h4>
<table class="orders"><%= render @orders %></table>
<%= will_paginate @orders %>
</div>
<% end %>
</div>
</div>