Many visual tweaks, suggested by Lan
[cs356-p2-videostore.git] / app / views / coitem / list.rhtml
index 2b0db69..92113ad 100644 (file)
@@ -2,7 +2,9 @@
 
 <table border="1">
   <tr>
+    <th>Item ID</th>
     <th>Customer</th>
+    <th>Type</th>
     <th>Rentable</th>
     <th>Overdue</th>
     <th>Date Checked Out</th>
   
 <% for coitem in @coitems %>
   <tr>
+    <td><%=h coitem.rentable.id.to_s %></td>
     <td><%=h coitem.customer.name %></td>
-    <td><%=h coitem.rentable.title %></td>
+    <td><%=h coitem.rentable.class %></td>
+    <% if coitem.rentable.type == Game %>
+    <td><%=link_to coitem.rentable.title.to_s, :controller => 'game', :action => 'show', :id => coitem.rentable %></td>
+    <% else %>
+    <td><%=link_to coitem.rentable.title.to_s, :controller => 'video', :action => 'show', :id => coitem.rentable %></td>
+    <% end %>
     <td><%=h tf_to_yesno(coitem.overdue?) %></td>
     <td><%=h coitem.out_date %></td>
     <td><%=h coitem.due_date %></td>
-    <td><%= link_to 'View', :action => 'show', :id => coitem %></td>
   </tr>
 <% end %>
 </table>