Forum: Ruby on Rails Routing by URL postfix

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.
Simon Stewart (Guest)
on 2006-02-07 11:27
(Received via mailing list)
Is it possible to separate the parts of a routing with a character
other than '/'? Specifically, I'd like to be able to do something

map.connect ':controller/:action.:format'

which would match

"blog/index.html" as {:controller => "blog", :action => "index",
:format => "html"}


"blog/index.atom" as {:controller => "blog", :action => "index",
:format => "atom"}

Currently, I use:

map.connect ':controller/*path'

and do some of the routing logic in the controller, which is doable
but not very clean. Before I wander off and write a patch, has anyone
done this already?


This topic is locked and can not be replied to.