Bypass XHR redirect by overriding redirect_to

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.

Hi Michael,