-<h1>Listing customers</h1>
+<h1>Listing Customers</h1>
-<table>
+<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>Balance</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 'Show', :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 'Destroy', { :action => 'destroy', :id => customer }, :confirm => 'Are you sure?', :method => :post %></td>
+ <td><%= link_to 'Remove', { :action => 'destroy', :id => customer }, :confirm => 'Are you sure?', :method => :post %></td>
</tr>
<% end %>
</table>