I am working in ruby on rails. Rails version 3.1.1. I have been using Geocoder gem to geocode locations based on street addresses and it is working just fine. Now I have been trying to use my visitors ip-address to locate them.
I have tried
result = request.location
and
ip = request.ip
result = Geocoder.search(ip)
The first option returns an nil, the second gives me a correct ip-address and an empty array.
Are there any configurations I need to do in order for this to work?
Any other smoother alternatives? I was looking into using HTML5 or some javascript in the browser, but that would not be optimal since I want to use the location on the server side.