Gmaps4rails - longitude and latitude in database no updated. <nested form>

家住魔仙堡 提交于 2019-12-23 12:26:43

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!