title: Refreshing page after remote => true modal form submission
body: <p>I have a Modal with form and after submitting it with no validation error i'm trying to close Modal and refresh page with new results. But i can't get it to work. I have this code (Rails 3):</p>
  
  <p>My Controller: </p>
  
  <pre><code>    def create
  
      @stuff = Stuff.new(params[:stuff])
  
         respond_to do |format|
            if @stuff.save
               format.js 
            else
               format.js
            end
         end
       end
  </code></pre>
  
  <p>_addModal.html.erb</p>
  
  <pre><code>&lt;div id="addModal" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"&gt;
      &lt;div class="modal-header"&gt;
      &lt;button type="button" class="close" data-dismiss="modal" aria-hidden="true"&gt;×&lt;/button&gt;
      &lt;h3 id="myModalLabel"&gt;Label&lt;/h3&gt;
      &lt;/div&gt;
          &lt;div class="modal-body"&gt;
              &lt;p&gt;
                  &lt;fieldset&gt;
                  &lt;label&gt;&lt;/label&gt;
                  &lt;%= render 'form2' %&gt;    
                  &lt;/fieldset&gt;
              &lt;/p&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  </code></pre>
  
  <p>_form2.html.erb</p>
  
  <pre><code>%= form_for(@stuff, :remote =&gt; true) do |f| %&gt;
  
     &lt;% if @stuff.errors.any? %&gt;
       &lt;div id="error_explanation"&gt;
         &lt;div class="alert"&gt;
            &lt;h2&gt;&lt;%= @stuff.errors.count %&gt;&lt;/h2&gt;
  
          &lt;ul&gt;
            &lt;% @stuff.errors.full_messages.each do |msg| %&gt;
             &lt;li&gt;&lt;%= msg %&gt;&lt;/li&gt;
            &lt;% end %&gt;
          &lt;/ul&gt;
              &lt;/div&gt;
            &lt;/div&gt;
                 &lt;% end %&gt;
  
       &lt;%= f.label :name %&gt;&lt;br /&gt;
       &lt;%= f.text_field :name %&gt;
  
  
      &lt;%= f.submit %&gt;
  
    &lt;% end %&gt;
  </code></pre>
  
  <p>create.js.erb</p>
  
  <pre><code>&lt;%- if @stuff.errors.any? %&gt;
  
             $('#addModal').html('&lt;%= escape_javascript(render :partial =&gt; "form2") %&gt;');
  
             &lt;%- else %&gt;
  
            $('#addModal').modal('hide').empty();
  
  
            &lt;%- end %&gt;
  </code></pre>
  
  <p>Any ideas how I can get this to work?</p>
  
  <p>Thanks!</p>
  
  <p><strong>Update:</strong></p>
  
  <p>Also i got few quetions:
  1) In case there are validation errors create.js.erb returns new Modal with 'form2' content only- without #addModal layout. How can i fix it? </p>
  
  <p>2) How can clear form after successful submision?</p>