mixplate
2007-Mar-21 01:20 UTC
rails method to get the current url that called the action?
hi, i implemented a captcha and basically need to redisplay the page with the fetched information. im trying redirect_to :back after the captcha is valid, but i think its going back in history. so basically i need to find a way to recapture the url that called the check captcha function. thoughts? thanks. -- 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 -~----------~----~----~----~------~----~------~--~---
mixplate
2007-Mar-21 12:59 UTC
Re: rails method to get the current url that called the acti
when i use render :action, i lose the url that i specified in my routes. hmmm, or maybe i can just create a new route for the check... -- 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 -~----------~----~----~----~------~----~------~--~---
Ben Munat
2007-Mar-21 18:26 UTC
Re: rails method to get the current url that called the action?
This is in a controller right? You should be able to use request.request_uri... b mixplate wrote:> hi, i implemented a captcha and basically need to redisplay the page > with the fetched information. > > im trying redirect_to :back after the captcha is valid, but i think its > going back in history. so basically i need to find a way to recapture > the url that called the check captcha function. > > thoughts? > > thanks. >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Rimantas Liubertas
2007-Mar-21 18:35 UTC
Re: rails method to get the current url that called the action?
2007/3/21, mixplate <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org>: <...>> im trying redirect_to :back after the captcha is valid, but i think its > going back in history. so basically i need to find a way to recapture > the url that called the check captcha function. > > thoughts?redirect_to :back should do exactly what you need - it works on information contained in http referef header, so it should go back to the page which originated the request. From the source: when :back request.env["HTTP_REFERER"] ? redirect_to(request.env["HTTP_REFERER"]) : raise(RedirectBackError) Regards, Rimantas -- http://rimantas.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 -~----------~----~----~----~------~----~------~--~---