How to load a Rails View inside an infobox using gmaps4rails & JQuery Ajax?
I would like to 开发者_Go百科know how can I load a Rails View inside a Infobox opened by Gmaps4Rails.infobox.
I did this way and work fine. O secret is put serviceObject, in some example show google_object.
<% content_for :scripts do %>
<script>
Gmaps4Rails.callback = function() {
for (var i = 0; i < this.markers.length; ++i) {
google.maps.event.addListener(Gmaps4Rails.markers[i].serviceObject, 'click', function(){
$('#info').load('/messages');
$('#info').dialog("open");
});
}
};
</script>
<% end %>
精彩评论