Fix 'maintenence' to 'maintenance' + layout reorganization
[cs356-p2-videostore.git] / app / views / merchandise / list.rhtml
1 <h1>Listing merchandises</h1>
2
3 <table border="1">
4   <tr>
5     <th>Merchandise ID</th>
6     <th>Title</th>
7     <th>Quantity Remaining</th>
8     <th>Price Per Unit</th>
9   </tr>
10   
11 <% for merchandise in @merchandises %>
12   <tr>
13     <td><%=h merchandise.id %></td>
14     <td><%=link_to merchandise.title.to_s, :action => 'show', :id => merchandise %></td>
15     <td><%=h merchandise.quantity %></td>
16     <td><%=h number_to_currency(merchandise.price) %></td>
17     <td><%= link_to 'Edit', :action => 'edit', :id => merchandise %></td>
18     <td><%= link_to 'Remove', { :action => 'destroy', :id => merchandise }, :confirm => 'Are you sure?', :method => :post %></td>
19   </tr>
20 <% end %>
21 </table>
22
23 <%= link_to 'Previous page', { :page => @merchandise_pages.current.previous } if @merchandise_pages.current.previous %>
24 <%= link_to 'Next page', { :page => @merchandise_pages.current.next } if @merchandise_pages.current.next %> 
25
26 <br />
27
28 <%= link_to 'New merchandise', :action => 'new' %>