Add title to the rentable listing
[cs356-p2-videostore.git] / app / views / rentable / list.rhtml
index 74c1cbc..0fe063d 100644 (file)
@@ -2,13 +2,17 @@
 
 <table>
   <tr>
+    <th>Title</th>
   <% for column in Rentable.content_columns %>
     <th><%= column.human_name %></th>
   <% end %>
   </tr>
-  
+
 <% for rentable in @rentables %>
   <tr>
+    <td>
+      <%=h Video.find(:first, :conditions => "rentable_id='#{rentable.id}'").title.to_s if Video.find(:first, :conditions => "rentable_id='#{rentable.id}'") %>
+    </td>
   <% for column in Rentable.content_columns %>
     <td><%=h rentable.send(column.name) %></td>
   <% end %>