Have you read the Rails Guide when routing? This is a great place to start exploring routing in Rails.
For example, you will find out that your second code block is not . Instead, it corresponds to the fact that the above guide applies to the Static Segment
You will also learn that to impose restrictions on a segment, as you seem to be trying in the first block of code, you should use the parameter :constraints , for example this wildcard pattern , or as described in the guide, Routing Routing
GET "/a/path/*all", :constraints => { :all => /.*/ }
However, the above restriction is redundant since the *all wildcard will match by default .* .
source share