phil.swenson-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2006-Aug-30 16:15 UTC
getting referrer from request
I''m having trouble retrieving the referrer from the request, here''s my code: referrer = headers["HTTP_REFERER"] I can see the referrer when I inspect the request object itself, but haven''t been able to figure out how to retrieve it. In the past I used the code above, but I''m not seeing the referrer in the headers for some reason (there is no HTTP REFERRER key). Any thoughts? Perhaps I''m retarded :) --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Hi Phil -- On 30-Aug-06, at 12:15 PM, phil.swenson-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org wrote:> I''m having trouble retrieving the referrer from the request, here''s my > code: referrer = headers["HTTP_REFERER"]Try: request.env[''HTTP_REFERER''] /Jeff -- http://re.visioni.st http://quotedprintable.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 -~----------~----~----~----~------~----~------~--~---
On 8/30/06, Jeffrey Hardy <packagethief-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > Hi Phil -- > > On 30-Aug-06, at 12:15 PM, phil.swenson-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org wrote: > > I''m having trouble retrieving the referrer from the request, here''s my > > code: referrer = headers["HTTP_REFERER"] > > Try: request.env[''HTTP_REFERER''] >Or better yet, request.referer -- Kent --- http://www.datanoise.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 -~----------~----~----~----~------~----~------~--~---
so whats the best way to handle a login controller that uses a before filter to catches users who arent logged in. How do you enable the user to go to the page they were trying to get to? Ive been having problems with request.env["HTTP_REFERER"] as well When I have a complex url like /books?id=5&c=4 then it works, but if it is simple like /books, it doesnt work correctly. Anyone figure this out? -- 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 -~----------~----~----~----~------~----~------~--~---