title: Rails restful routes and singular resources
body: <p>I am having a problem with restful routes and singular resources, originally I had this code in the show view on my account resource.</p>
  
  <pre><code>&lt;%= link_to book.title, book_path(:search =&gt; book.title) %&gt;
  </code></pre>
  
  <p>and it worked fine, then I changed account to be a singular resource, e.g</p>
  
  <p>from</p>
  
  <pre><code>map.resources :accounts
  </code></pre>
  
  <p>to</p>
  
  <pre><code>map.resource :account
  </code></pre>
  
  <p>and now I get the error ...</p>
  
  <pre><code>book_url failed to generate from {:search=&gt;"Dracula", :controller=&gt;"books", :action=&gt;"show"}, expected: {:controller=&gt;"books", :action=&gt;"show"}, diff: {:search=&gt;"Dracula"}
  </code></pre>
  
  <p>remove the view line of code, and everything works fine. Also changing it to</p>
  
  <pre><code>&lt;%= link_to book.title, :controller =&gt; "books", :action =&gt; "show", :search =&gt; book.title %&gt;
  </code></pre>
  
  <p>makes it work.</p>
  
  <p>I have created a standalone rails application demonstrate my problem in isolation <a href="http://github.com/jowls/singular_resource_bug" rel="nofollow">http://github.com/jowls/singular_resource_bug</a></p>
  
  <p>Is this a bug? brought about through some combination of singular resources and restful routes?</p>
  
  <p>This was on rails 2.3.10</p>
  
  <p>thanks</p>