Commit 10f02ec
Changed files (3)
app/views/gyms/index.html.erb
@@ -0,0 +1,14 @@
+<div class="row">
+ <div class="large-12 columns">
+ <h1>Gyms</h1>
+ <table>
+ <% @gyms.each do |gym| %>
+ <tr>
+ <td><%= gym.name %></td>
+ <td><%= gym.address %>, <%= gym.city %>, <%= gym.state %>, <%= gym.country %></td>
+ <td><a href="https://maps.google.com/?q=<%= gym.latitude %>,<%= gym.longitude %>" target="_blank"><%= t('.view_map') %></a></td>
+ </tr>
+ <% end %>
+ </table>
+ </div>
+</div>
config/locales/en.yml
@@ -30,6 +30,9 @@ en:
log_out: "Log out"
profile_edit: "Edit profile"
profile_view: "View profile"
+ gyms:
+ index:
+ view_map: View map
registrations:
new:
username: "Username"
spec/models/location_spec.rb
@@ -4,9 +4,10 @@ describe Location do
describe '.from' do
it 'returns the correct lat/long' do
latitude, longitude = Location.
- from('1817 Crowchild Trail NW', 'Calgary', 'AB', 'Canada')
- expect(latitude).to be_within(0.1).of(51.0706973)
- expect(longitude).to be_within(0.1).of(-114.1178249)
+ from('1301 16 Ave NW', 'Calgary', 'AB', 'Canada')
+
+ expect(latitude).to be_within(0.1).of(51.0647815)
+ expect(longitude).to be_within(0.1).of(-114.0927691)
end
end
end