In Ruby on Rails Routing I Would Like to Use Dash `-` Instead of Underscore `_`
- by pablitostar
I would like all the URLs for my web applications to use dash - instead of underscore _ for word separators. I'm surprised about a couple of things really:
Google et al. continue to distinguish them.
That RoR doesn't have a simple global configuration parameter to map - to _ in the routing. Or does it?
I found a few questions here and elsewhere, but the best solution I've seen is to use :as or a named route. That's quite annoying. So I'm thinking of modifying the Rails routing to check for that global config and change - to _ before dispatching to a controller action. But before I do that, I'm hoping someone can save me the trouble!
Thanks in advance for any help, or even confirmation that my approach makes sense. I'd submit it back. BTW, I'm currently on 2.3.8, but hope to migrate to 3 soon.