Am I missing something obvious? Map keeps loading @oldjson which I set in the controller and won’t be replaced when I set it in the view.
View code:
<% @json = Map.find_by_id('39').to_gmaps4rails %>
<%= gmaps("markers" => {"data" => @oldjson, "options" => { "draggable" => true } } ) %>
<script>
Gmaps.map.replaceMarkers(<%= @json %>);
</script>
Thanks.
I guess you”re facing a js error with this current code.
The reason is the following:
the js used and created by
gmaps4railsis put within theyield :scriptsso your additionnal js here is called before the map is created
Solution: