0

Here is my loop data

<% @location.each do |location| do %>
  <%= location.name %>
  <%= image_tag location.image %>
  <%= location.address %>
  <%= location.latitude %>
  <%= location.longtitude %>
<% end %>

I want to pass my rails data to this javascript array [ ] Pls Help Me Thank you!!!

var o = document.getElementById("map-main");
void 0 !== o && null != o && google.maps.event.addDomListener(window, "load", function() {
  function o(e, n, o, a, t, i, l, s) { return '<div class="map-popup-wrap"><div class="map-popup"><div class="infoBox-close"><i class="fa fa-times"></i></div><div class="map-popup-category">' + gon.l + '</div><a href="' + e + '" class="listing-img-content fl-wrap"><img src="' + o + '" alt=""></a> <div class="listing-content fl-wrap"><div class="card-popup-raining map-card-rainting" data-staRrating="' + l + '"><span class="map-popup-reviews-count">( ' + s + ' reviews )</span></div><div class="listing-title fl-wrap"><h4><a href=' + e + ">" + a + '</a></h4><span class="map-popup-location-info"><i class="fa fa-map-marker"></i>' + t + '</span><span class="map-popup-location-phone"><i class="fa fa-phone"></i>' + i + "</span></div></div></div></div>" }
  var a = [
    [o("listing-single.html", "Food and Drink", "images/all/8.jpg", "Luxary Restaurant", "W 85th St, New York, NY ", "+38099231212", "4", "5"), 40.76221766, -73.96511769, 2, n],
    [o("listing-single.html", "Gym - Fitness", "images/all/3.jpg", "Gym In CityCenter", "40 Journal Square Plaza, Jersey City, NJ", "+38099231212", "4", "5"), 40.88496706, -73.88191222, 3, n],
  ],
  t = e("#map-main").attr("data-map-zoom"),
  i = e("#map-main").attr("data-map-scroll");
kh deep
  • 333
  • 1
  • 3
  • 9

0 Answers0