mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
root route should go at the *top* of the routes file, because it is the most popular route and should be matched first
This commit is contained in:
parent
d2f98e5b55
commit
fe0e3880e8
1 changed files with 3 additions and 1 deletions
|
@ -247,7 +247,9 @@ module ActionDispatch
|
|||
#
|
||||
# root :to => 'pages#main'
|
||||
#
|
||||
# You should put the root route at the end of <tt>config/routes.rb</tt>.
|
||||
# You should put the root route at the top of <tt>config/routes.rb</tt>,
|
||||
# because this means it will be matched first. As this is the most popular route
|
||||
# of most Rails applications, this is beneficial.
|
||||
def root(options = {})
|
||||
match '/', options.reverse_merge(:as => :root)
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue