title: Make ruby model work with generated route
body: <p>So before you say it, I have read through this <a href="http://guides.rubyonrails.org/routing.html" rel="nofollow">http://guides.rubyonrails.org/routing.html</a> and also I'm using Rails 3.2.13</p>
  
  <p>I have defined wiki in my routes file as a resource and should therefore get the generated routing functions such as wiki_path() etc. I read in the above article that if a route function is defined, and you pass in an object, it can figure out the id based if it responds to the id method which all ActiveRecord classes do.</p>
  
  <p>Here's my problem, my Wiki class does not inherit from ActiveRecord, and though I've defined the id function as below, the router is still passing in the entire wiki object as the id parameter.</p>
  
  <pre><code>def id 
    url_id = wiki.slug
    url_id ||= wiki.title
    url_id
  end
  </code></pre>
  
  <p>The error I get is this when I try to create a new wiki:</p>
  
  <p><strong>ActionController::RoutingError at /wiki/what-is-the-meaning-of-life</strong></p>
  
  <pre><code>No route matches {:action=&gt;"show", :controller=&gt;"wiki", 
  :id=&gt;#&lt;Wiki:0x007f92a6793700 @user=nil, @path_to_repo="wiki.git", 
  @wiki=#&lt;Gollum::Wiki:70133917472560 wiki.git&gt;, @page=nil, @persisted=false, 
    @attributes={"title"=&gt;"what-is-the-meaning-of-life"}&gt;}
  </code></pre>
  
  <p>I want the :id to be the return value of the id function in the Wiki class.</p>