Debugging routes

I’m having trouble with my routes when I do routing generation. Here
are my routes:

map.connect ‘’, :controller => “home”

map.connect “library/read/:id/:page_number”,
:controller => “Library”,
:action => “read”,
:requirements => { :id => /\d+/,
:page_number => /(\d+)|(\w+.html)/ }
map.connect ‘:controller/service.wsdl’, :action => ‘wsdl’

Install the default route as the lowest priority.

map.connect ‘:controller/:action/:id/’

My link_to looks like this:

link_to( ‘Read’, :action => ‘read’, :id => line_item, :page_number => 1

However, whenever I generate a URL using the named route library. I end
up with a route like:


Where I want is:


Also is there anyway to force a trailing / on the end of my routes? In
this case I’d really like it to generate:


instead of:


Is there some logging I can turn on to see which route it’s picking when
generating the links? How do I debug this?


This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs