title: url_for of a custom RESTful resource (composite key; not just id)
body: <p>Given the following resource definition:</p>
  
  <pre><code>map.resources :posts, :except =&gt; [:show]
  map.post '/:year/:month/:slug, :controller =&gt; :posts, :action =&gt; :show
  </code></pre>
  
  <p>I can make <code>url_for</code> work for me, using this syntax:</p>
  
  <pre><code>&lt;%= link_to @post.title, post_url(:year =&gt; '2010', :month =&gt; '02', :slug =&gt; 'test') %&gt;
  </code></pre>
  
  <p>But is there a way to make this work?</p>
  
  <pre><code>&lt;%= link_to @post.title, @post %&gt;
  </code></pre>
  
  <p>Currently it throws this error:</p>
  
  <pre><code>No route matches {:year=&gt;#&lt;Post id: 1, title: "test", (...)&gt;, :controller=&gt;"posts", :action=&gt;"show"}
  </code></pre>
  
  <p>Apparently it passes the @post object to the first route parameter (seems like a Rails bug...). But can I make this work for me? I'll add that messing with <code>default_url_options</code> is a dead end.</p>
  
  <p>Solution working only in Rails 3.x is ok, but I would prefer not to use any plugins.</p>