https://stackoverflow.com/questions/15963532
質問
Can I access the IP address of the client from request header?If yes,how?
解決
Yes you can.
visitor_ip = request.env['REMOTE_ADDR']