"-" instead of "_" in routes?

Hi all

I'd like to have minus signs "-" instead of underscores "_" in my routes. Is there an easy to do that?

my_controller/show_something/123 # <= not cool my-controller/show-something/123 # <= much cooler

Given that Rails is open source, the answer is certainly yes. You can monkey-patch the routing process to call #underscore (or just change hyphens to underscores) before calling #camelize on the URI path. Alternately, you can alter (monkey-patch) the #camelize method such that it deals with hyphens anyway, though that might have unforeseen consequences.

There is no built in way to do it as far as I know, however.

Thanks a lot Josh

--Greg