title: link_to helper not rendering the correct URL for a model
body: <p>I have a <code>Request</code> model. In one of my views, I'm trying to render a link to it.</p>
  
  <p>The first thing I tried was the following:</p>
  
  <pre><code>.requests-container
    = link_to request, class: "request-link"
  </code></pre>
  
  <p>The following link renders as <code>&lt;a href="/requests?class=request__title"&gt;My request 1&lt;/a&gt;</code>. The <code>class</code> option gets mixed in the URL. That's understandable, though, since <code>link_to</code> seems to expect the URL as the second parameter.</p>
  
  <hr>
  
  <p>After that, I tried this version:</p>
  
  <pre><code>.requests-container
    = link_to request
  </code></pre>
  
  <p>The result turned out to be even stranger, though, since the generated link was the following: <code>&lt;a href="/requests"&gt;My request 1&lt;/a&gt;</code>.</p>
  
  <p>In this link, the <code>href</code> attribute is generated as <strong><code>/requests</code></strong> instead of <strong><code>/requests/2</code></strong>, the expected URL for this ActiveRecord object.</p>
  
  <hr>
  
  <p>Even more strangely, my following attempt,</p>
  
  <pre><code>.requests-container
    = link_to request, request, class: "request-link"
  </code></pre>
  
  <p>yielded a fully working link: <code>&lt;a class="request-link" href="/requests/2"&gt;My request 1&lt;/a&gt;</code>. That is the expected link and it works fine.</p>
  
  <hr>
  
  <p>Is this a known behaviour in Rails? There are other parts in my code where I've just used <code>link_to &lt;activerecord object&gt;</code> and it has worked fine, so I am not completely sure why it didn't work in this case.</p>