Small Cleanups + Merchandise Search
[cs356-p2-videostore.git] / app / views / customer / searchresults.rhtml
index a6488ce..37d8b2e 100644 (file)
@@ -1,25 +1,25 @@
-<h1>Search Results</h1>
+<h1>Search Results for '<%= @query[0].to_s %>'</h1>
 
 <% if @customers.empty? %>
 <p>Sorry, there were no results</p>
 <% else %>
-<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?', :post => true %></td>
+    <td><%= link_to 'Remove', { :action => 'destroy', :id => customer }, :confirm => 'Are you sure?', :method => :post %></td>
   </tr>
 <% end %>
 </table>