title: Re-rendering Rails partial AFTER saving the model through a form
body: <p>I'm re-rendering a partial after submitting a <code>remote: true</code> form, but my problem is that it seems to re-render the partial BEFORE fully completing the form's update action. As a result, it renders old data on the page, and shows updated info only after a full refresh (or when I submit the form yet again). Is there a way to force the application to re-render the partial after everything is completed, in order to display only the new info? Or am I missing a step here?</p>
  
  <blockquote>
    <p>update.js.erb:</p>
  </blockquote>
  
  <pre><code>$("#methods").html("&lt;%= escape_javascript(render partial: 'methods') %&gt;");
  </code></pre>
  
  <blockquote>
    <p>owner_controller.rb</p>
  </blockquote>
  
  <pre><code>respond_to :html, :js, :json
  
  def update
    if owner.update_attributes(owner_params)
      respond_to do |format|
        format.js
      end
    else
      fail_update
    end
  end
  </code></pre>