I decided to update my templating technology to HAML. I'm new to it, and wondered if this is possible at all:
:javascript
<% @checkins.each do |checkin| %>
var latLng = new google.maps.LatLng(<%= checkin.latitude %>, <%= checkin.longitude %>);
var marker = new google.maps.Marker({
position: latLng,
map: map,
title: '<%= escape_javascript(checkin.title) %>'
});
google.maps.event.addListener(marker, 'click', function() {
document.location = '<%= checkin_path(checkin) %>';
});
<% end %>
It's easy to see that the parts of the code I'm having problems with are the ones related to Ruby code
<% @checkins.each do |checkin| %>
or
document.location = '<%=checkin_path(checkin) %>';
I tried to change the latter to:
- @checkins.each do |checkin|
but it's not working out so far. I already read many other questions here about the same topic, but I haven't really been able to find a 'straight-forward' answer.