Ruby on Rails Friday, February 25, 2011

Hi,
For my upcoming application I need to find the location of the user.
I am doing this by using the "GeoIp" plugin.
For geoIp I have to find the IP address of the incoming request.
I have written the code to get the IP address:-
"client_ipaddress=request.env["HTTP_X_FORWARDED_FOR"] ||
request.remote_addr"
But it is giving me the IP address of the machine. Is it right?
If yes then how the GeoIp will find the location of the machine.
I have tried some online demo's which actually detect the IP address of
the router and depending on that they are finding the location.

Can anyone tell me Am I on right path?

Thanks,
Tushar

--
Posted via http://www.ruby-forum.com/.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

No comments:

Post a Comment