How to create a conditional route

how can I create a conditional route that works for the following:

http://site.com/1vcs1YUf1Z

Where 1vcs1YUf1Z is the UID.

Is there a way to add a routing parameter at the end of my route file, which says that if the following condition is met (10 characters ending with the first and / or this), then go to the next and pass it as a UID?

thank

+3
source share
1 answer
get 'projects/:uid' => 'controller#action',
  :constraints => { :uid => /^[0-9a-z]{10}$/i }
+6
source

All Articles