title: Can't link_to correct path when using nested shallow routes
body: <p>I am using nested routes in my rails app. I am successfully able to link through to <code>clients/:id/invoices/:id</code> The problem I am running into I think is that I am using shallow routes, so after clicking an <code>invoice</code> <code>show link</code> my app redirects from <code>/client/:id</code> to <code>/invoice/:id</code>. Now when I try to go back from this <code>show</code> link to my <code>client_path</code> I get the two routes mixing up.</p>
  
  <p>for example <code>invoice/34</code> becomes <code>client/34</code> when I try to <code>link_to</code> my client path when it should change to the <code>clients id</code>.</p>
  
  <p>I think this might have something to do with my <code>show</code> action in my <code>clients_controller</code> being <code>@client = Client.find(params[:id])</code></p>
  
  <p>My routes</p>
  
  <pre><code>resources :clients do
  resources :invoices, shallow: true
  end
  </code></pre>
  
  <p>My clients controller show action</p>
  
  <pre><code>def show
  @client = Client.find(params[:id])
  @invoices = @client.invoices
  end
  </code></pre>
  
  <p>Clients show.html.erb</p>
  
  <pre><code>&lt;% @invoices.where(published: false).each do |invoice| %&gt;
    &lt;tr&gt;
     &lt;td&gt;&lt;%= invoice.sender %&gt;&lt;/td&gt;
     &lt;td&gt;&lt;%= invoice.reciever %&gt;&lt;/td&gt;
     &lt;td&gt;&lt;%= invoice.amount %&gt;&lt;/td&gt;
     &lt;td&gt;&lt;%= invoice.currency %&gt;&lt;/td&gt;
     &lt;td&gt;&lt;%= invoice.date %&gt;&lt;/td&gt;
     &lt;td&gt;&lt;%= link_to 'Show', invoice_path(invoice) %&gt;&lt;/td&gt;
    &lt;/tr&gt;                
  &lt;% end %&gt;  
  </code></pre>
  
  <p>and my invoice show.html.erb</p>
  
  <pre><code>&lt;%= link_to 'Back', client_path, class: "btn btn-primary" %&gt;
  </code></pre>