2013-02-07 7 views
0

我有這樣的問題。我正在使用google_maps_for_rails gem,它無法正確找到位置。我運行來自文檔的所有說明。爲什麼谷歌地圖的軌道寶石創建位置與零經濟?

這裏是我的application.erb:

<%= yield :scripts%> 

我的模型:

attr_accessible :address, :latitude, :longtitude 

acts_as_gmappable 

def gmaps4rails_address 
    self.address 
end 

但是當我創建的位置,我得到的對象與零經度。這裏是日誌:

INSERT INTO "locations" ("address", "created_at", "latitude", "longtitude", "name", 
"updated_at") VALUES (?, ?, ?, ?, ?, ?) [["address", "Lviv"], ["created_at", Thu, 07 
Feb 2013 10:56:45 UTC +00:00], ["latitude", 49.839683], ["longtitude", nil], ["name", 
nil], ["updated_at", Thu, 07 Feb 2013 10:56:45 UTC +00:00]] 

有人可以幫助我嗎?

回答

1

見代碼:

attr_accessible :address, :latitude, :longtitude 

錯字:longtitude

請注意,您可以個性化領域according to my doc

acts_as_gmappable :lat => "latitude", :lng => "longtitude" 
+0

一個時刻,我會盡力。 – skrypalyk

+0

非常感謝您快速回答) – skrypalyk

相關問題