Andy Harvey
Andy Harvey

Reputation: 12663

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?

Upvotes: 0

Views: 433

Answers (1)

apneadiving
apneadiving

Reputation: 115541

Within the json, the description triggers the infowindow creation.

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

Upvotes: 1

Related Questions