Hi,
I''m trying to retrieve a capture group from a regular expression for a
given route. Here''s the code:
map.category '':category'', :controller =>
''product'', :action =>
''list'', :requirements => { :category =>
/[\w|-]+(-\d*)?/}
I''d like to capture the end (-\d*) inside ":page" to match
"flowers"
but also "flowers-p2", "flowers-p3" etc for pages numbers.
I''d like to
make it pass the following test:
assert_routing "flowers-p2", :controller =>
''product'', :action =>
''list'', :category => ''flowers'', :page
=> 2
assert_routing "flowers", :controller =>
''product'', :action =>
''list'', :category => ''flowers''
Does anyone knows if it''s possible to achieve this (and how) ?
Thibaut Barrère / LoGeek
--
http://blog.logeek.fr - learning content for developers
http://evolvingworker.com - tools for a better day
--~--~---------~--~----~------------~-------~--~----~
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@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---