§ Named something else? class Location < ActiveRecord::Base geocoded_by :address, :latitude => :lat, :longitude => :lng end § Don’t have lat/long? Have an address? def address [street_1, city, state, country].compact.join(', ') end
to that location? § @nearest.distance_to(request.coordinates) § Midpoint between here and there? § Geocoder::Calculations.geographic_center([@loc_array, [@nearest.lat, @nearest.lng]])
“address method” on your model: def address [street_1, city, state, country].compact.join(', ') end Geocoder.search( Location.where(:name => "Fort Worth").first.address_array )