问题
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
回答1:
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
来源:https://stackoverflow.com/questions/8708262/gmaps4rails-longitude-and-latitude-in-database-no-updated-nested-form