title: How do I get my new registrations Devise form to be AJAXified?
body: <p>What I want to happen is when the account is successfully created, the form that was submitted should disappear and a message should appear (depending on the status of the registration).</p>
  
  <p>If it was successful, they should see a simple "Thank you. Please check your email."</p>
  
  <p>If it wasn't, then they should see an appropriate message - like "Sorry, that email has already been taken."</p>
  
  <p>This is my form:</p>
  
  <pre><code>&lt;div class="nine columns offset-by-three sign-up-form"&gt;
    &lt;%= form_for(resource, :as =&gt; resource_name, :class =&gt; "send-with-ajax", :url =&gt; user_registration_path(resource), :validate =&gt; true, :html =&gt; { :id =&gt; 'user_new' }) do |f| %&gt;
      &lt;div class="six columns alpha"&gt; 
         &lt;%= f.text_field :email, :placeholder =&gt; "your-email@address.com", :input_html =&gt; {:autofocus =&gt; true}, :validate =&gt; true %&gt;
      &lt;/div&gt;              
      &lt;div class="three columns sign-up alpha"&gt;
        &lt;%= f.submit :label =&gt; "Submit", :value =&gt; "Sign Me Up!"  %&gt;
        &lt;div class="ajax-response"&gt;&lt;%= devise_error_messages! %&gt;&lt;/div&gt;
      &lt;/div&gt;
      &lt;% end %&gt;
    &lt;/form&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>This is my <code>create.js.erb</code>:</p>
  
  <pre><code>$(document).ready(function() {    
    $('#user_new').submit(function() { 
      $(this).fadeOut(600).hide(); 
      $(this).append('&lt;h3&gt;Thank You. You should receive an email shortly.&lt;/h3&gt;').fadeIn(1000);
    });    
  )}
  </code></pre>
  
  <p>But this doesn't work properly. For instance, when I press submit and the email address is already in the db - nothing happens.</p>
  
  <p>P.S. I know that if it were a 'regular' form, I would do <code>format.js</code> within the controller that is handling this form - and work out the status codes &amp; messages there - but Devise is a different beast and I don't want to generate new controllers and override functionality that I shouldn't, when I am not fully comfortable.</p>