title: Rails 4 action routes with simple_form and shallow nested resources
body: <pre><code>resources :users, shallow: true do
      resources :shoes
  end
  </code></pre>
  
  <p>This gives me two different routes for create and edit </p>
  
  <pre><code>user_shoes_path
  shoes_path
  </code></pre>
  
  <p>In my shoes <code>_form.html.erb</code> if I leave the form tag :url as default I get a missing routes error when I submit a new or updated shoe. </p>
  
  <p>If I supply the url in the form I can get it to work for either the new or the edit update, but I can't get it to work for both.</p>
  
  <p>This works for the new:</p>
  
  <pre><code>&lt;%= simple_form_for :shoe, url: user_shoes_path do |f| %&gt;
  </code></pre>
  
  <p>This works for the edit, but will fail once it tries the actual update since it redirects to <code>/:param_id</code>:</p>
  
  <pre><code>&lt;%= simple_form_for :shoe, url: shoes_path(@shoe) do |f| %&gt;
  </code></pre>
  
  <p>How can I make it work for both? Thanks.</p>