Router :requirements

At this casts you can see an example:
http://railscasts.com/episodes/70-custom-routes