Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Tidy up customer listing

  • Loading branch information...
commit 866c93cc3681173a7ee0ffd4e03986e3e89ca411 1 parent 54408c3
@keviniano keviniano authored
Showing with 4 additions and 10 deletions.
  1. +4 −10 app/views/customers/index.html.erb
View
14 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>
Please sign in to comment.
Something went wrong with that request. Please try again.