5261: When redirecting during an AJAX request, send the target URI in
authorTom Clegg <tom@curoverse.com>
Thu, 5 Mar 2015 19:07:52 +0000 (14:07 -0500)
committerTom Clegg <tom@curoverse.com>
Thu, 5 Mar 2015 19:07:52 +0000 (14:07 -0500)
commit57991d19a58903863194043717b2875417a40fe7
tree351459bb3621038d0b1cf0a17682840a09294c5e
parentd0583fc94ca74daf94327ad3446ff72bd5e5bea1
5261: When redirecting during an AJAX request, send the target URI in
a JSON object {"href":"..."} instead of responding 302.

This lets us use "redirect_to X" to mean "send the user to page X"
regardless of whether the request is an XHR. Without it, client-side
code never sees the 302 at all: the browser handles the redirect
transparently, and the client-side code typically ends up trying to
parse HTML content as JSON.
apps/workbench/app/controllers/application_controller.rb