Rails Routes :requirements

Posted by Chris Kilmer on Stack Overflow See other posts from Stack Overflow or by Chris Kilmer
Published on 2010-05-21T21:57:26Z Indexed on 2010/05/21 22:00 UTC
Read the original article Hit count: 166

Filed under:
|
|

I want to set a route :requirements on an array that verifies a particular parameter is included in an array:

atypes = [:culture, :personality, :communication]  
map.with_options(:path_prefix => ':atype',  
  :requirements => {:atype => atypes.include?(:atype)}) do |assessment|  
  ...
end  

I haven't been able to find any documentation on how to accomplish this. Any help would be appreciated.

© Stack Overflow or respective owner

Related posts about ruby

Related posts about rails