blackangel6291-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2007-Oct-15 13:38 UTC
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? --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On Mon, 2007-10-15 at 13:38 +0000, blackangel6291-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org wrote:> 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 -- Tore Darell toredarell-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org Trondheim, NO http://tore.darell.no/ --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Thanks, it works. --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Tore Darell wrote:> On Mon, 2007-10-15 at 13:38 +0000, blackangel6291-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org wrote: >> 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 > > > -- > Tore Darell > toredarell-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org > Trondheim, NO > http://tore.darell.no/i used request.remote_ip but i am getting different ip address at local and at server.. its strange... can any one give any idea.. -- 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
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. --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---