title: Delete the temporary object from object.new?
body: <p>In the show action, there is logic that requires me to define:</p>
  
  <pre><code>@object.nested_object.new (or @object.nested_object.build or @object.nested_object.create)
  </code></pre>
  
  <p>However, when it's time to show a list of the nested_objects using something like:</p>
  
  <pre><code>@object.nested_objects.each do |nested_objects|
    #display
  end
  </code></pre>
  
  <p>There is an extra line item for the temporary nested object created with @object.nested_object.new.</p>
  
  <p>Is there a way to forcefully remove that temporary object before I display the list of the actual nested_objects?</p>
  
  <p>Or is there another way of accomplishing the following:</p>
  
  <pre><code>-creating a temporary nested_object for logic tests
  -showing a list of nested_objects
  </code></pre>
  
  <p>I've tried stuff like:</p>
  
  <pre><code>temp_nested_object = @object.nested_object.new
  temp_nested_object.delete
  </code></pre>
  
  <p>but wasn't successful.</p>
  
  <p>Thanks for your time!</p>
  
  <p>UPDATE:
  I'm trying to accomplish this:</p>
  
  <pre><code>&lt;% if can? :create, @project.tasks.build %&gt;
  </code></pre>
  
  <p>From here:
  <a href="https://github.com/ryanb/cancan/wiki/Nested-Resources" rel="nofollow">https://github.com/ryanb/cancan/wiki/Nested-Resources</a>
  I've tried to find other ways of accomplishing this:
  <a href="https://github.com/ryanb/cancan/issues/608" rel="nofollow">https://github.com/ryanb/cancan/issues/608</a>
  but seems like I need to workaround it in the view.</p>