0

I have such problem. I'm using google_maps_for_rails gem and it is can't find location correctly. I run all instructions from documentation.

Here is my application.erb:

<%= yield :scripts%>

My model:

attr_accessible :address, :latitude, :longtitude

acts_as_gmappable

def gmaps4rails_address 
  self.address
end

but when I create location I get object with nil longtitude. Here is log:

   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]]

Can someone help me ?

1 Answer 1

1

See your code:

attr_accessible :address, :latitude, :longtitude

Typo: longtitude

Note that you can personalize the fields according to my doc:

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.