Small Cleanups + Merchandise Search
[cs356-p2-videostore.git] / app / views / merchandise / list.rhtml
index c8a1ba0..91e8f5e 100644 (file)
@@ -1,20 +1,21 @@
 <h1>Listing merchandises</h1>
 
-<table>
+<table border="1">
   <tr>
-  <% for column in Merchandise.content_columns %>
-    <th><%= column.human_name %></th>
-  <% end %>
+    <th>Merchandise ID</th>
+    <th>Title</th>
+    <th>Quantity Remaining</th>
+    <th>Price Per Unit</th>
   </tr>
   
 <% for merchandise in @merchandises %>
   <tr>
-  <% for column in Merchandise.content_columns %>
-    <td><%=h merchandise.send(column.name) %></td>
-  <% end %>
-    <td><%= link_to 'Show', :action => 'show', :id => merchandise %></td>
+    <td><%=h merchandise.id %></td>
+    <td><%=link_to merchandise.title.to_s, :action => 'show', :id => merchandise %></td>
+    <td><%=h merchandise.quantity %></td>
+    <td><%=h number_to_currency(merchandise.price) %></td>
     <td><%= link_to 'Edit', :action => 'edit', :id => merchandise %></td>
-    <td><%= link_to 'Destroy', { :action => 'destroy', :id => merchandise }, :confirm => 'Are you sure?', :method => :post %></td>
+    <td><%= link_to 'Remove', { :action => 'destroy', :id => merchandise }, :confirm => 'Are you sure?', :method => :post %></td>
   </tr>
 <% end %>
 </table>