Regular Expression Routes in Rails
        Posted  
        
            by Kevin Sylvestre
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by Kevin Sylvestre
        
        
        
        Published on 2010-06-09T04:23:29Z
        Indexed on 
            2010/06/09
            4:32 UTC
        
        
        Read the original article
        Hit count: 189
        
ruby-on-rails
I am looking to create a rails route that is capable of accepting requests using a regular expression. Specifically, I need optional paths. As an example:
"(/first)?(/second)?"
Would match:
/first
/second
/first/second
But not:
/second/first
Is this possible? Thanks.
© Stack Overflow or respective owner