def location_city
@remote_ip = request.remote_ip
@result = Net::HTTP.get(URI.parse("http://api.sypexgeo.net/json/#{@remote_ip}"))
@city = ?
end
{
"ip":"123.45.67.89",
"city":{
...
"name_ru":"Сеул",
...
},
"region":{
...
},
"country":{
...
}
}
"http://api.sypexgeo.net/json/#{remote_ip}"
@result["city"]["name_ru"]
raise @result.inspect