title: how does form_for know the difference when submitting :new :edit
body: <p>I've generated a scaffold, let's call it scaffold test.
  Within that scaffold, I've got a _form.html.erb thats being render for action's :new => :create and :edit => :update</p>
  
  <p>Rails does a lot of magic sometimes and I cannot figure out how the form_for knows how to call the proper :action when pressing submit between :new and :edit</p>
  
  <p>Scaffolded Form</p>
  
  <pre><code>&lt;%= form_for(@test) do |f| %&gt;
  
  
    &lt;div class="actions"&gt;
      &lt;%= f.submit %&gt;
    &lt;/div&gt;
  &lt;% end %&gt;
  </code></pre>
  
  <p>vs.
  Un-scaffolded Form</p>
  
  <pre><code> &lt;% form_for @test :url =&gt; {:action =&gt; "new"}, :method =&gt; "post" do |f| %&gt;
         &lt;%= f.submit %&gt;
   &lt;% end %&gt;
  </code></pre>
  
  <h1>Edit template</h1>
  
  <pre><code>&lt;h1&gt;Editing test&lt;/h1&gt;
  
  &lt;%= render 'form' %&gt;
  </code></pre>
  
  <h1>New template</h1>
  
  <pre><code>&lt;h1&gt;New test&lt;/h1&gt;
  
  &lt;%= render 'form' %&gt;
  </code></pre>
  
  <p>As you can see theres no difference between the forms
  How can both templates render the same form but use different actions?</p>