Add Address class
This commit is contained in:
parent
1b07d05c8e
commit
c14f186c53
1
Gemfile
1
Gemfile
|
@ -1,6 +1,7 @@
|
|||
source 'http://rubygems.org'
|
||||
|
||||
gem 'rails', '3.0.4'
|
||||
gem 'geokit'
|
||||
|
||||
group :development do
|
||||
gem 'pg'
|
||||
|
|
|
@ -32,6 +32,7 @@ GEM
|
|||
builder (2.1.2)
|
||||
erubis (2.6.6)
|
||||
abstract (>= 1.0.0)
|
||||
geokit (1.5.0)
|
||||
i18n (0.5.0)
|
||||
mail (2.2.15)
|
||||
activesupport (>= 2.3.6)
|
||||
|
@ -70,6 +71,7 @@ PLATFORMS
|
|||
ruby
|
||||
|
||||
DEPENDENCIES
|
||||
geokit
|
||||
pg
|
||||
rails (= 3.0.4)
|
||||
sqlite3
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
class Address
|
||||
include Geokit::Geocoders
|
||||
|
||||
def self.find_lat_lng(address)
|
||||
MultiGeocoder.geocode(address).ll.split(',').map{|s| s.to_f}
|
||||
end
|
||||
end
|
Loading…
Reference in New Issue