"-" instead of "_" in routes?

Hi all

I don’t like “www.mysite.xx/some_cool_controller”, I’d rather like to
have “www.mysite.xx/some-cool-controller”.

Is there an easy way to achieve this? :slight_smile:

Thanks
Josh

I don’t like “www.mysite.xx/some_cool_controller”, I’d rather like to
have “www.mysite.xx/some-cool-controller”.

Is there an easy way to achieve this? :slight_smile:

There’s not a magical plugin if that’s what you mean. I looked into it
once and you run into some problems with how Rails converts urls to
class
names.

Use named routes…

map.with_options :controller => ‘refer_a_friend’ do |r|
r.refer_a_friend ‘refer-a-friend’, :action => ‘index’
r.send_referrals ‘refer-a-friend/send-referrals’, :action =>
‘send_referrals’
r.referrals_sent ‘refer-a-friend/referrals-sent’, :action =>
‘referrals_sent’
end

etc…

Thanks, but that’s clearly too ugly to me. :wink:

Maybe there should be a configuration option to specify the placeholder?
:slight_smile: