b702f7f69daa3db14ab2bd021eea1a828b8d791e
[cs356-p2-videostore.git] / app / views / purchase / list.rhtml
1 <h1>Listing purchases</h1>
2
3 <table border="1">
4   <tr>
5     <th>Date</th>
6     <th>Quantity</th>
7     <th>Type</th>
8     <th>Title</th>
9     <th>Price</th>
10     <th>Customer</th>
11   </tr>
12   
13 <% for purchase in @purchases %>
14   <tr>
15     <td><%=link_to purchase.date, :action => 'filterbydate', :id => purchase.date %></td>
16     <td><%=h purchase.quantity %></td>
17     <td><%=link_to purchase.class, :action => 'filterbytype', :id => purchase.type %></td>
18     <td><%=h purchase.title %></td>
19     <td><%=h purchase.price %></td>
20     <td><%=link_to purchase.customer.name, :action => 'filterbycust', :id => purchase.customer_id %></td>
21   </tr>
22 <% end %>
23 </table>
24
25 <%= link_to 'Previous page', { :page => @purchase_pages.current.previous } if @purchase_pages.current.previous %>
26 <%= link_to 'Next page', { :page => @purchase_pages.current.next } if @purchase_pages.current.next %> 
27