title: How does Rails decide when to rewrite a URL
body: <p>I'm trying to learn how the routing/URL writing mechanisms work. I'm in Rails 2.3 but most of the modules are the same in Rails 3.</p>
  
  <p>Anyway, rails generates helpers for all your routes of the format resource_path, and resource_url.</p>
  
  <p>When you call these helpers with no arguments <code>root_path()</code>, the operations are different than when you call them with extra arguments <code>root_path(:random_param=&gt;"myquery")</code>. When you pass options to the _path helper, Rails triggers the UrlRewriter#rewrite method, and does a much more comprehensive process.</p>
  
  <p>I'm trying to find out where and how this trigger to the UrlRewriter happens? Does rails actually store the 'default' no-params url as a string somewhere?</p>