Displaying 1 result from an estimated 1 matches for "multigeocoder".
2009 Feb 23
2
geokit - using :through to connect models
...el. the models look like:
,----[ employer.rb ]
| class Employer < ActiveRecord::Base
| acts_as_mappable
| before_validation_on_create :geocode_address
|
| has_many :internships
| belongs_to :account
| belongs_to :role
|
| private
| def geocode_address
| geo=GeoKit::Geocoders::MultiGeocoder.geocode(address1 + " " + city + " " + state + " " + zip)
| errors.add(:address, "Could not Geocode address") if !geo.success
| self.lat, self.lng = geo.lat,geo.lng if geo.success
| end
|
| end
`----
and an internship:
,----[ internship.rb ]
| cla...