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 Thanks a lot Josh -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On 4/1/07, Joshua Muheim <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > 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 > > Thanks a lot > Joshmap.connect ''foo-bar'', :controller => ''foo_bar'', :action => ''index'' -- Rick Olson http://lighthouseapp.com http://weblog.techno-weenie.net http://mephistoblog.com --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On Sun, Apr 01, 2007 at 07:16:34PM +0200, Joshua Muheim wrote:> 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 coolerGiven 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 --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---