title: Clear Rails form after submitting
body: <p>I want to clear text_form after message submitting. This is my form:</p>
  
  <pre><code>&lt;%= form_for :chat, :html =&gt; {:id =&gt; 'send_form'}, :url =&gt; {:controller =&gt; :chat, 
         :action =&gt; :chat_save }, :remote =&gt; true do |f| %&gt;
      &lt;%= f.text_field(:text, :class =&gt; "text_field round") %&gt;
      &lt;%= f.submit(:class =&gt; 'button round') %&gt;           
  &lt;% end %&gt;
  </code></pre>
  
  <p>I`ve done, like in this topic: <a href="https://stackoverflow.com/questions/6053039/clear-rails-remote-form-after-submitting">Clear Rails remote form after submitting</a>. First I try this in my js file:</p>
  
  <pre><code>$('#send_form').submit(function() {
  $('#chat_text').val('');
  });
  </code></pre>
  
  <p>the text_field become clear, but it send a blank line. Then I try this one, it sends message now, but text_field doesn`t become empty:</p>
  
  <pre><code>$(document).ready(function () {
      $("#send_form").live("ajax:complete", function(evt, data, status, xhr){
          $('#chat_text').val('');
      });
  }
  </code></pre>
  
  <p>May be some libraries missed? Can anyone helps?</p>