title: Devise Registration#update via JS in Rails
body: <p>I'm trying to update the User model through Devise with AJAX and have Devise respond with the proper javascript file.</p>
  
  <p>I want to submit the form remotely to the registrations#update action, but this isn't working with the default response from Devise, which uses the following from the RegistrationsController:</p>
  
  <pre><code>respond_with resource, :location =&gt; after_update_path_for(resource)
  </code></pre>
  
  <p>The above tries to redirect to the default route instead of rendering the update.js.erb file. I am able to overwrite the action and have it work with the following change:</p>
  
  <pre><code>respond_to do |format|
      format.html
      format.js
   end
  </code></pre>
  
  <p>But, this seems very brute force as I'm overriding the entire action. Is there a simple way for Devise to know to respond with javascript instead of doing its default redirect?</p>