You can use location.href = "/path/to/redirect" in your javascript to send one page to another. You'd have to look up how to set the 301/302 redirect header though, not sure about that.
James On Thu, Jan 14, 2010 at 9:28 PM, Scott Olmsted <[email protected]> wrote: > > Perhaps I didn't make myself clear. The form has Simple Captcha to deter > spam. If the CAPTCHA is not entered correctly, then the form should be > replaced by the same form with an error message and the blinking and all. > That part works. > > If the post passes Simple Captcha's test, then it should redirect to a page > showing all posts in the thread, including the one just entered. This is the > part that doesn't work, the browser doesn't respond to the new page, > delivered in its entirety if I interpret the log correctly. > > Scott > > > At 08:42 PM 1/14/2010, you wrote: > > If you're redirecting to another page, why is there are need to make it an > AJAX request? Just make it a standard POST and handle the redirect in the > controller. > > James > > On Thu, Jan 14, 2010 at 8:39 PM, Scott Olmsted <[email protected]> wrote: > > A client has a site with a page that uses form_remote_tag to replace a > form with either a "Thanks for your submission" message or the form with an > error message and a blinking effect: > > <% form_remote_tag > :url => {:action => 'submit_review', :id => @product}, > :update => 'review_form', > :complete => visual_effect(:pulsate, "review_form", :pulses => 5, > :duration => 2.5) do -%> > > I would like to do the same for a form on a different page, but on success > instead of replacing the form with a message, I just want to redirect to > another page entirely. > > I have not figured out how to do this. I can change the controller code and > Rails says it did the redirect, but the browser doesn't see it. Is this even > possible? > > Thanks, > > Scott > > -- > SD Ruby mailing list > [email protected] > http://groups.google.com/group/sdruby > > > -- > SD Ruby mailing list > [email protected] > http://groups.google.com/group/sdruby > > -- > SD Ruby mailing list > [email protected] > http://groups.google.com/group/sdruby >
-- SD Ruby mailing list [email protected] http://groups.google.com/group/sdruby
