title: How to implement redirect response with an AJAX request in Rails 3?
body: <p>I have a simple scenario where I want to request a page. The request format is AJAX. If there is some error in the controller/action logic for that request, I want to redirect to an error page. The issue is that a redirect is not a JavaScript response type, so I am not sure whether it will work. </p>
  
  <p>If there are no errors, then I want the page to be updated via the appropriate JavaScript response type.</p>
  
  <p>What is best practice to achieve redirect responses given that the request format is AJAX?</p>