I''m using a form_remote_tag for a small form for which I want to show any errors without the page having to reload. This part works fine, but how do I use redirect_to with it? Once the form is submitted and saved successfully (with no errors), I want to redirect to another controller, but what''s happening is the page isn''t reloading - the output from that other controller is just replacing the form in that ajax element. I couldn''t find anything about it in the API docs for form_remote_tag. --~--~---------~--~----~------------~-------~--~----~ 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 Sep 10, 2006, at 7:33 PM, Jeff wrote:> > I''m using a form_remote_tag for a small form for which I want to show > any errors without the page having to reload. This part works fine, > but how do I use redirect_to with it? Once the form is submitted and > saved successfully (with no errors), I want to redirect to another > controller, but what''s happening is the page isn''t reloading - the > output from that other controller is just replacing the form in that > ajax element. I couldn''t find anything about it in the API docs for > form_remote_tag. > > > >You have to use js to change the location.href. Put something like this in your controller: render(:update) {|page| page.redirect_to :action => ''foo'' } -Ezra --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Thanks! I am using that piece of code and the page redirects fine, but just before the redirect I see a chunk of javascript (or some kind of code) appear on the page (try/catch block of some sort). Is there any way to hide this code? --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---