title: Build vs new in Rails 4
body: <p>My question is similar to <a href="https://stackoverflow.com/questions/4954313/build-vs-new-in-rails-3">Build vs new in Rails 3</a>.</p>
  
  <p>In Rails 3, I could build an object in the view to check authorization via cancan.</p>
  
  <pre><code>&lt;% if can? :create, @question.answers.new %&gt;
    # Code...
  &lt;% end %&gt;
  </code></pre>
  
  <p>In Rails 3, the difference between <code>.new</code> and <code>.build</code> was that <code>.build</code> added the newly built object to the parent's collection, which then resulted in an additional record in the view, which obviously was not desired.</p>
  
  <p>In Rails 4, however, both add the object to the collection, rendering an empty record in the view. </p>
  
  <p>Has anyone any advice on how to solve this? Checking if a record is <code>.persisted?</code> in the view would be an option but somehow I feel I shouldn't have to do that.</p>
  
  <p><strong>Edit:</strong> To clarify, the CanCan model looks like this:  </p>
  
  <pre><code>can :manage, Answer do |answer|
    user.belongables.include?(answer.question.try(:belongable))
  end
  </code></pre>
  
  <p>Because of this, I can't just check by class. An actual instance is actually needed to compare based on the relation.</p>