We Recommend

The Rails Way The Rails Way
Now, for the first time, there’s a comprehensive, authoritative guide to building production-quality software with Rails. Pioneering Rails developer Obie Fernandez and a team of experts illuminate the entire Rails API, along with the Ruby idioms, design approaches, libraries, and plug-ins that make Rails so valuable.


Posted By

indianocean on 03/29/07


Tagged

routes


Versions (?)


Who likes this?

3 people have marked this snippet as a favorite

bbebop
happolati
stainless


list of all of the routes you have defined


Published in: Rails 


URL: http://weblog.jamisbuck.org/2007/2/19/route-to_s

  1. ActionController::Routing::Routes.routes.each do |r|
  2. puts r
  3. end
  4.  
  5. # Or list all named routes
  6. ActionController::Routing::Routes.named_routes.routes.each do |name, route|
  7. puts "%20s: %s" % [name, route]
  8. end

Report this snippet 

You need to login to post a comment.