Apparently there is no clean way to do ajax redirects in Rails. The recommended way to do that is to send a regular
Now, what follows is a relatively cleaner way to handle redirection in ajax calls.
On the rails side, we create a helper that returns a response that has no content but just one header
x_ajax_redirect_url and status code 302.
1 2 3
1 2 3 4 5 6 7 8 9 10