Is it possible to redirect to different location in controller during ajax processing? I mean that I send an AJAX request but during its processing in controller I find out that I want to cancel the ajax request and redirect to completely different location. I’m using this in my customer form. It works like this: someone clicks create button on my form, it checks attributes of form via ajax, if they are wrong it returns errors otherwise it redirects to new customer.
Any ideas?
Is it possible to redirect to different location in controller during ajax processing? I
Share
I’ve found something much more better so here’s the code that you need to add to application_controller:
and then in action use standard
redirect_to