title: In Rails, how to see all the "path" and "url" methods added by Rails's routing? (update: using Rails console)
body: <p><strong>[update: by not using <code>rake routes</code>, just to understand Rails console a little more]</strong></p>
  
  <p>It seems like inside of "rails console" for Rails 3, we can use <code>controller</code>, but in Rails 2.2 or 2.3, we need to use <code>@controller</code></p>
  
  <p>And in Rails 3, we can print out all the routes added by Rails routing for a scaffold <code>foo</code>:</p>
  
  <pre><code>ruby-1.9.2-p0 &gt; puts controller.public_methods.grep(/path|url/).grep(/foo/).sort.join("\n")
  edit_foo_path
  edit_foo_url
  foo_path
  foo_url
  foos_path
  foos_url
  new_foo_path
  new_foo_url
  </code></pre>
  
  <p>but on Rails 2.3.8, it gives a bunch of <code>formatted_foos_path</code>, etc, and gives nothing for Rails 2.2.2.  How to make it print out for Rails 2.3.8 and 2.2.2?</p>
  
  <hr>
  
  <p>Details for Rails 2.3.8:</p>
  
  <pre><code>ruby-1.8.7-p302 &gt; puts @controller.public_methods.grep(/path|url/).grep(/foo/).sort.join("\n")
  formatted_edit_foo_path
  formatted_edit_foo_url
  formatted_foo_path
  formatted_foo_url
  formatted_foos_path
  formatted_foos_url
  formatted_new_foo_path
  formatted_new_foo_url
  </code></pre>