Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Updating view to show distance

  • Loading branch information...
commit d30cea7c5438eab68114229af24084ce643badad 1 parent c469983
@pat pat authored
Showing with 3 additions and 1 deletion.
  1. +3 −1 app/views/contacts/index.html.erb
View
4 app/views/contacts/index.html.erb
@@ -16,6 +16,7 @@
<% unless @contacts.empty? %>
<table>
<tr>
+ <th>Distance</th>
<th>First name</th>
<th>Last name</th>
<th>Street address</th>
@@ -25,8 +26,9 @@
<th>Postal code</th>
</tr>
- <% for contact in @contacts %>
+ <% @contacts.each_with_geodist do |contact, distance| %>
<tr>
+ <td><%= number_with_delimiter number_with_precision(distance, 0) %></td>
<td><%= h contact.first_name %></td>
<td><%= h contact.last_name %></td>
<td><%= h contact.street_address %></td>
Please sign in to comment.
Something went wrong with that request. Please try again.