On May 21, 2010, at 3:13 PM, Chris Kilmer wrote:
> I want to set a route :requirements on an array that verifies a
> particular parameter is included in an array.
>
> Something to the effect of:
>
> <pre>
> atypes = [:culture, :personality, :communication]
> map.with_options(:path_prefix => '':atype'',
> :requirements => {:atype => atypes.include?(:atype)}) do
|assessment|
> ...
> end
> </pre>
>
> I haven''t been able to find any documentation on how to accomplish
this.
> Any help would be appreciated.
:requirements => {:atype => /culture|personality|communication/}
I believe the right hand side of any requirement has to be a regexp...
-philip
--
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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit this group at
groups.google.com/group/rubyonrails-talk?hl=en.