Ruby on Rails Thursday, March 31, 2011

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

/calls
/calls/abc
/calls/abc/def
/calls/abc/def/ghi

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:

/calls(/%group(/%view(/%subselect)?)?)?

but never got it to work.

Thank you,
pedz

--
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@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

No comments:

Post a Comment