0

I have a server written in Ruby. One of the purposes is to send a confirmation email when a user registers with a link. That link needs to have the ip address of the server in it. How can I get the ip address of the server locally so that I can put that as part of the email message that I send to the client.

user1152262
  • 61
  • 1
  • 10
  • possible duplicate: http://stackoverflow.com/questions/42566/getting-the-hostname-or-ip-in-ruby-on-rails – Baldrick Feb 15 '12 at 14:27

2 Answers2

0

try request.fullpath from your controller

sameera207
  • 16,547
  • 19
  • 87
  • 152
-1

I think ActionDispatch::Request#remote_ip (request.remote_ip in your controller`s action) is what you are looking for.

Hck
  • 9,087
  • 2
  • 30
  • 25