Created
October 23, 2013 07:40
-
-
Save pixeltrix/7114147 to your computer and use it in GitHub Desktop.
The `format: false` removes the optional segment from the end of the route but doesn't affect any path parameters so you need the regexp constraint to allow matching on periods.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NoFormatTest::Application.routes.draw do | |
root 'root#index' | |
scope '/foo/:bar', format: false, bar: /[^\/\?]+/ do | |
get '/', to: 'root#index' | |
get '/baz', to: 'root#index' | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment