Search code examples
ruby-on-railsgmaps4rails

How to set google-maps-for-rails infowindow render true/false from the view?


I'm using Google-Maps-for-Rails in a Rails app.

In the Model controller I have

def gmap_settings(location, marker)
      marker.infowindow render_to_string(:partial => "/path/to/partial", :locals => { :object => location})
end

I'm displaying maps in several views. In some cases, displaying multiple maps in the same page.

Some maps need an infowindow, but others do not.

How can I define whether the infowindow is rendered or not from the view?


Solution

  • Within the json, the description triggers the infowindow creation.

    Simply remove or adapt what you pass to the gmaps helper.