I use geocode to get country, state and city via IP, but Freegeoip hasn't a good accuracy. I configured geocoder to use google. example:
geocoder.rb
Geocoder.configure do |config|
config.lookup = :google
config.api_key = "API_KEY"
config.timeout = 5
config.units = :km
end
But geocoder uses Freegeoip and not google. I don't know if I can use google to get country, state and city via IP. Which geocoder provider can uses GEOIP?
my_controller.rb
@result = request.location.to_yaml
view
--- !ruby/object:Geocoder::Result::Freegeoip cache_hit: data: city: Caxias Do Sul region_code: "23" region_name: Rio Grande do Sul metrocode: "" zipcode: "" longitude: "-51.1833" latitude: "-29.1667" country_code: BR ip: 201.22.227.49 country_name: Brazil