Many visual tweaks, suggested by Lan
[cs356-p2-videostore.git] / app / views / customer / list.rhtml
index c9bce2b..2f4bd9c 100644 (file)
@@ -2,19 +2,19 @@
 
 <table border="1">
   <tr>
-  <th>Customer ID</th>
-  <% for column in Customer.content_columns %>
-    <th><%= column.human_name %></th>
-  <% end %>
+    <th>Customer ID</th>
+    <th>Name</th>
+    <th>Phone</th>
+    <th>Debt</th>
   </tr>
   
 <% for customer in @customers %>
   <tr>
-  <td><%=h customer.id %></td>
-  <% for column in Customer.content_columns %>
-    <td><%=h customer.send(column.name) %></td>
-  <% end %>
-    <td><%= link_to 'View', :action => 'show', :id => customer %></td>
+    <td><%=h customer.id %></td>
+    <td><%=link_to customer.name.to_s, :action => 'show', :id => customer %></td>
+    <td><%=h customer.phone %></td>
+    <td><%=h number_to_currency(customer.debt) %></td>
+    <td><%= link_to "Checked Out Items", :controller => :coitem, :action => 'filterbycustomerid', :id => customer %></td>
     <td><%= link_to 'Edit', :action => 'edit', :id => customer %></td>
     <td><%= link_to 'Remove', { :action => 'destroy', :id => customer }, :confirm => 'Are you sure?', :method => :post %></td>
   </tr>