title: Rails iterate over only the persisted records associated to an object
body: <p>I have something like this in my <code>show</code> action:</p>
  
  <pre><code>def show
    @blog = Blog.find(params[:id])
    @new_comment = @blog.comments.build
  end
  </code></pre>
  
  <p>Now in the view I do two things:</p>
  
  <ol>
  <li>I render the <code>_form.html.erb</code> for the <code>Comment</code> so that the user can add a comment to this blog</li>
  <li>I want to be able to iterate over the <strong>existing</strong> comments for this blog in order to display them.</li>
  </ol>
  
  <p>I am having problems with number <strong>2</strong>.  The issue is that as I iterate over the associated <code>comments</code> with this:</p>
  
  <pre><code>&lt;% @blog.comments.each do |comment| %&gt;
  </code></pre>
  
  <p>It is grabbing that <code>@new_comment</code> while iterating over the associated blogs.  How can I <strong>exclude</strong> that built-but-not-yet-persisted <code>@new_comment</code>?</p>
  
  <p>It would be nice if something like <code>@blog.comments.each_with_id</code> worked, or even <code>@blog.comments.persisted.each</code>.  Ultimately I only want to iterate over the persisted <code>comments</code> associated to this <code>blog</code>.  </p>
  
  <p>I would prefer not to have to nest a conditional that asks if the comment is <code>persisted?</code>.  I'm hoping there is an iterator out there for my current situation that just grabs the persisted records.</p>