Permalink
Browse files

Tidy up customer listing

  • Loading branch information...
1 parent 54408c3 commit 866c93cc3681173a7ee0ffd4e03986e3e89ca411 @keviniano keviniano committed Sep 22, 2011
Showing with 4 additions and 10 deletions.
  1. +4 −10 app/views/customers/index.html.erb
@@ -16,35 +16,29 @@
<table>
<tr>
- <th>First Name</th>
- <th>Last Name</th>
+ <th>Name</th>
<th>DOB</th>
<th>Primary Phone</th>
<th>Secondary Phone</th>
<th>Email Address</th>
<th>Address</th>
- <th></th>
-<% if can? :edit, Customer %>
+<% if can? :destroy, Customer %>
<th></th>
<% end %>
</tr>
<% for customer in @customers %>
-
<tr>
- <td><%= customer.first_name %></td>
- <td><%= customer.last_name %></td>
+ <td><%= link_to customer.name_reversed, customer %></td>
<td><%= customer.birth_date %></td>
<td><%= customer.phone_number_1 %></td>
<td><%= customer.phone_number_2 %></td>
<td><%= customer.email %></td>
<td><%= customer.address %></td>
- <td><%= link_to "Show", customer %></td>
- <% if can? :edit, @customer %>
+ <% if can? :destroy, customer %>
<td><%= button_to "Delete", customer, :confirm=>"Are you sure you want to delete this user?", :method=>:delete %></td>
<% end %>
</tr>
-
<% end %>
</table>

0 comments on commit 866c93c

Please sign in to comment.