Route with optional segments

In Rails 2.3.5, is this the proper way to do this?

map.calls “calls/:group/:view/:subselect”, :controller => ‘calls’,
:action => ‘index’
map.calls “calls/:group/:view”, :controller => ‘calls’,
:action => ‘index’
map.calls “calls/:group”, :controller => ‘calls’,
:action => ‘index’
map.calls “calls”, :controller => ‘calls’,
:action => ‘index’

I want to accept


where “group” would be assigned “abc” in cases 2-4, “view” would be
assigned “def” in cases 3 and 4, and subselect would be assigned “ghi”
in case 4.

I kept trying to do something like:


but never got it to work.

Thank you,

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs