Forum: Ruby on Rails Rails routes with prefix before the :id

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Sharcho (Guest)
on 2009-05-07 20:33
(Received via mailing list)
This works:
map.connect '/bananas/pdf/file/:id.pdf', :controller =>
'bananas', :action => 'pdf'

This doesn't work:
map.connect '/bananas/pdf/file_:id.pdf', :controller =>
'bananas', :action => 'pdf'

So once I change the slash to underscore the route doesn't work the
way I expect it to.
Is there some way I need to escape the routes to make them work (Rails
This topic is locked and can not be replied to.