Skip to content

Instantly share code, notes, and snippets.

@rickywid
Created October 25, 2015 05:53
Show Gist options
  • Save rickywid/dc16add8a0ab2795de9d to your computer and use it in GitHub Desktop.
Save rickywid/dc16add8a0ab2795de9d to your computer and use it in GitHub Desktop.
= link_to "Home", root_url
%h1= @user.name
%h2 nearby cities
- for name in @user.nearbys(25)
%li
= link_to name.name, @user
= name.distance.round(2)
miles
#map
:javascript
var map;
function initMap() {
map = new google.maps.Map(document.getElementById('map'), {
center: {lat: @user.latitude, lng: @user.longitude},
zoom: 8
});
}
%script{:async => "", :defer => "", :src => "https://maps.googleapis.com/maps/api/js?key=AIzaSyBdMDyASdvSs-EL3DUXLggdI9WKcZenQKg&callback=initMap"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment