Add list of just-purchased items (this transaction) to the purchase view
[cs356-p2-videostore.git] / app / views / purchase / menu.rhtml
index ce8a646..6f5abd1 100644 (file)
@@ -1,11 +1,23 @@
 <h1>Purchase Menu</h1>
 
+<h3>Customer Information</h3>
 <ul>
   <li>Customer ID: <%= @customer.id %></li>
   <li>Customer Name: <%= @customer.name %></li>
   <li>Total Price: <%= @total_price %></li>
 </ul>
 
+<h3>Items Purchased</h3>
+<% if @items.empty? %>
+  None
+<% else %>
+<ul>
+<% for item in @items %>
+  <li><%= item.title %></li>
+<% end %>
+</ul>
+<% end %>
+
 <ul>
   <li><%=link_to 'Rent an Item', :action => 'rent_begin' %></li>
   <li><%=link_to 'Buy Merchandise', :action => 'buy_begin' %></li>