title: Reload on submit form Ajax call
body: <p>I'm using a form_for @user to submit a sign up registration. The controller handles the logic usually when the user is saved to reload the page but for some reason, using javascript and ajax will not reload the page when it saves and creates the new user.</p>
  
  <p>I'm assuming I will need to implement this function somehow to reload the page after it saves? I've been messing around with it but I can't figure out anything that still submits the form properly but also reloads the page after.</p>
  
  <p>I currently have the bottom part commented out so the submit button actually works right now but I have no way of it reloading the page. I know there is a function to reload, but I don't know how to put it in the function below so it actually submits the page correctly.</p>
  
  <pre><code>// $(".myform").click(function() {
  //     $.ajax({
  //        type    : 'POST',
  //        url     : '/', // like the "action" path on your form element
  //        data    : $("myform").serialize(), // serialize your form data
  //        success : function(response){
  //            // the form was submitted successfully
  //            // so now you can reload with javascript
  //             location.reload();
  //        }
  //     });
  
  //     // stop default behavior of submitting the form
  //     return false;
  // });
  </code></pre>
  
  <p>The form I'm trying to submit is:</p>
  
  <pre><code>&lt;%= form_for @user, :remote =&gt; true do |f| %&gt;
    &lt;div id="msform"&gt;
  &lt;!-- multistep form --&gt;
    &lt;!-- progressbar --&gt;
    &lt;ul id="progressbar"&gt;
      &lt;li class="active"&gt;Part 1&lt;/li&gt;
      &lt;li&gt;Part 2&lt;/li&gt;
    &lt;/ul&gt;
    &lt;!-- fieldsets --&gt;
    &lt;fieldset&gt;
      &lt;h2 class="fs-title"&gt;Part 1&lt;/h2&gt;
      &lt;h3 class="fs-subtitle"&gt;Name/Email/Password&lt;/h3&gt;
      &lt;%= f.text_field :username, :placeholder =&gt; "Your Name"%&gt;&lt;br /&gt;
      &lt;%= f.text_field :email, :placeholder =&gt; "Email"%&gt;
      &lt;%= f.password_field :password, :placeholder =&gt; "Password" %&gt;&lt;br /&gt;
      &lt;input type="button" name="next" class="next action-button" value="Next" /&gt;
    &lt;/fieldset&gt;
    &lt;fieldset&gt;
      &lt;h2 class="fs-title"&gt;Part 2&lt;/h2&gt;
      &lt;h3 class="fs-subtitle"&gt;Your site name&lt;/h3&gt;
      &lt;%= f.text_field :name, :placeholder =&gt; "What do you want to be called?"%&gt;&lt;br /&gt;
      &lt;input type="button" name="previous" class="previous action-button" value="Previous" /&gt;
      &lt;input type="submit" name="submit" class="submit action-button" value="Submit" /&gt;
    &lt;/fieldset&gt;
  &lt;/div&gt;
  &lt;% end %&gt;
  </code></pre>