title: Change the name of the :id parameter in Routing resources for Rails
body: <p>I looked around on how to change the dynamic params slot and found this post that does the exact thing.
  The post is <a href="https://thoughtbot.com/blog/rails-patch-change-the-name-of-the-id-parameter-in" rel="noreferrer">https://thoughtbot.com/blog/rails-patch-change-the-name-of-the-id-parameter-in</a></p>
  
  <p>Basically what it does is, if following is the routes:</p>
  
  <pre><code>map.resources :clients, :key =&gt; :client_name do |client|
    client.resources :sites, :key =&gt; :name do |site|
      site.resources :articles, :key =&gt; :title
    end
  end
  </code></pre>
  
  <p>These routes create the following paths:</p>
  
  <pre><code>/clients/:client_name
  /clients/:client_name/sites/:name
  /clients/:client_name/sites/:site_name/articles/:title
  </code></pre>
  
  <p>One solution is to override the <code>def to_param</code> method in the model, but I want this without touching the model itself.</p>
  
  <p>But since its for Rails 2.x, how can I achieve the same for Rails 3?</p>
  
  <p><strong>Update</strong></p>
  
  <p>This app is using Mongoid. Not AR.
  So, the gem friendly cannot be used afaik.</p>