title: Partial form in rails 3 needing different link depending on New or Edit
body: <p>I have a basic setup of views that was generated by the Rails 3 scaffolding.  It gives me a partial view <strong>_form.html.erb</strong>.  Both my <strong>edit.html.erb</strong> and my <strong>new.html.erb</strong> render this partial view.</p>
  
  <p>In the partial view, I want to have a link_to that goes to different paths depending on if it is being rendered by the <strong>new</strong> or the <strong>edit</strong> view.</p>
  
  <p>Is there an easy way to do this?</p>
  
  <p>My code looks like this currently, but does not allow for different paths.</p>
  
  <pre><code>&lt;%= f.submit %&gt; or &lt;%= link_to 'Go back', models_path %&gt;
  </code></pre>
  
  <p>If it helps, I am trying to send them back to the page they came from (they come from different places for add and edit)</p>