You would be best, IMHO, using a hash and rewriting the JS to be a bit
more intelligent when adding the markers.
Unfortunately I am not that good in JavaScript so was trying to match
the input with what the script was using.
I have modified the controller as such
@sites = Array.new
$i = 0
for zone in @zones do @sites[$i] = [zone.name, zone.lat, zone.lng, zone.id]
$i += 1
end
and in my view I am using to to_json method to get the proper json but I
have no idea how to modify the script so any help will be greatly
appreciated.
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.