I am playing with the Geocoder gem, I added this code to user model
include GeoKit::Geocoders
geocoded_by :full_street_address # can also be an IP address
after_validation :geocode # auto-fetch coordinates
and in a different controller, in the CarController#index I am calling:
zip_code = '94301'
aaa = Geocoder.search(zip_code).first.coordinates
puts '==='
puts aaa.inspect
puts '==='
But instead of
s[0].latitude # => 37.4457966
s[0].longitude # => -122.1575745
s[0].address # => "Palo Alto, CA 94301, USA"
I got
undefined method `search' for Geokit::Geocoders::Geocoder:Class
What's incorrect with the setup of Geocoder?