Forum: Ruby on Rails Retrieving requester IP

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
4ddf8432a838f716cc499e43131e5e58?d=identicon&s=25 James Englert (Guest)
on 2008-11-29 18:29
(Received via mailing list)
Hey All,
   How can you access the requesting computer's IP address?

Thanks,
Jim Englert
4a9cd711ccb80f1ab3ce17450c2857e4?d=identicon&s=25 Greg Willits (-gw-)
on 2008-11-29 20:07
(Received via mailing list)
On Nov 29, 2008, at 9:28 AM, James Englert wrote:

> How can you access the requesting computer's IP address?

In a controller you can use request.remote_ip. So...

   @visitor_ip = request.remote_ip

-- gw
This topic is locked and can not be replied to.