Vicer Ontero wrote: >> And make sure you're *not* using the :update option on your remote_form. >> 'page.redirect_to()' will generate javascript similar to Hassan's >> aforementioned suggestion. > > Hi, just a note that this does not work. Because the redirect gets > trapped inside the Ajax call. If you use firebug you can see what > happens. > > So it seems the only way to redirect is to use a javascript redirect as > mentioned on: > http://stackoverflow.com/questions/1215177/cannot-do-response-redirect-from-page-with-ajax-controls
You're right. There's a confinient helper to generate the right javascript (http://apidock.com/rails/ActionView/Helpers/PrototypeHelper/JavaScriptGenerator/GeneratorMethods/redirect_to): def find_created_actions unless @if_login render :update do |page| flash[:login]="..." page.redirect_to(:controller=>"login",:action=>"login") end end [...] end -- 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-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.