4

I have a model place with attributes name, state, longitude, and latitude. A model travel_plan has many places.

I'm using nested form gem for places in the travel plan form.

My problem is that the longitude and latitude were not updated when name and state were updated.

In my place.rb

belongs_to :travel_plan  

acts_as_gmappable

def gmaps4rails_address
  "#{name},#{state}"
end

def gmaps4rails_infowindow
  "<h4>#{name}</h4>"
end
t56k
  • 6,769
  • 9
  • 52
  • 115
Jack Koh
  • 93
  • 5

1 Answers1

4

The answer lies here.

These two settings are particularly relevant for your question:

:check_process : true/false (if set to false, geocoding will be made at every save/update)

:checker : string (only if check_process is true), could be a method or a db column boolean

apneadiving
  • 114,565
  • 26
  • 219
  • 213