Forum: Ruby on Rails Routing by URL postfix

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Dbca1a090226cbbed88f7f3de6c8372c?d=identicon&s=25 Simon Stewart (Guest)
on 2006-02-07 10: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
like:

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

which would match

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

and

"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?

Regards,

Simon
This topic is locked and can not be replied to.