A lot of calls in Rails end in a redirect_to, and this is really an
unnecessary round trip in the case of XHR calls. This might sound
crazy, but why not just handle the redirect on the server? I realize
in some cases a redirect will probably be better if the redirected
resource is cached, but that's not always the case.

Is there any advice/prior art on doing such a thing, and is it
sensible to do it? I'm thinking the best way is to monkey-patch the
default redirect_to method.

--
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@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Search Discussions

  • Bill Walton at Dec 23, 2011 at 3:23 pm
    Hi Michael,
    On Thu, Dec 22, 2011 at 6:33 PM, Michael Mahemoff wrote:
    A lot of calls in Rails end in a redirect_to, and this is really an
    unnecessary round trip in the case of XHR calls. This might sound
    crazy, but why not just handle the redirect on the server? I realize
    in some cases a redirect will probably be better if the redirected
    resource is cached, but that's not always the case.

    Is there any advice/prior art on doing such a thing, and is it
    sensible to do it? I'm thinking the best way is to monkey-patch the
    default redirect_to method.
    The RJS library provides a server-side redirect_to for use with
    prototype.js. You might want to start there.

    HTH,
    Bill

    --
    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@googlegroups.com.
    To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouprubyonrails-talk @
categoriesrubyonrails
postedDec 23, '11 at 8:16a
activeDec 23, '11 at 3:23p
posts2
users2
websiterubyonrails.org
irc#RubyOnRails

2 users in discussion

Bill Walton: 1 post Michael Mahemoff: 1 post

People

Translate

site design / logo © 2022 Grokbase