Capturing an IP Address

How do I capture an IP address and send it into a database field?
There is no DRY convention for this like a password_confirmation for
example right?

model.ip_address = request.remote_ip

Thanks, it works.

Tore Darell wrote:

on your local machine it might give you the ip of your lan/intranet
(from your router). on your server you get the external one given to
you by your isp.