Joshua Muheim
2007-Oct-18 08:53 UTC
rerquest.whole_url? :: does this exist already somewhere?
Hi all I need to determine the whole URL that a user visits. So I created the following method: class ActionController::AbstractRequest def whole_url protocol + host_with_port + request_uri end end However, I can''t imagine that there''s not already a method like this somewhere implemented? Or isn''t there? Thanks for info Josh -- 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 -~----------~----~----~----~------~----~------~--~---
Ashley Thomas
2007-Oct-18 14:41 UTC
Re: rerquest.whole_url? :: does this exist already somewhere
request.env[''REQUEST_URI''] should do it. It won''t include the query string in the path (those are in params) or any anchor fragment. -- 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 -~----------~----~----~----~------~----~------~--~---