# Routes :requirments

**URL:** <https://www.ruby-forum.com/t/routes-requirments/189014>\
**Category:** Rails\
**Created:** [May 22, 2010, 12:13am UTC](https://www.ruby-forum.com/t/routes-requirments/189014 "2010-05-22T00:13:05Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![kampers](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/54ee81/32.png) [@kampers](https://www.ruby-forum.com/u/kampers)\
**Post date:** [May 22, 2010, 12:13am UTC](https://www.ruby-forum.com/t/routes-requirments/189014/1 "2010-05-22T00:13:05Z")

</div>

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:

```
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.

---

<div class="post-metadata">

**Author:** ![kampers](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/54ee81/32.png) [@kampers](https://www.ruby-forum.com/u/kampers)\
**Post date:** [May 22, 2010, 12:26am UTC](https://www.ruby-forum.com/t/routes-requirments/189014/2 "2010-05-22T00:26:14Z")

</div>

On May 21, 2010, at 3:13 PM, Chris K. wrote:

> end
> 
> 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
