1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Document the defaults method

This commit is contained in:
Ryan Bigg 2010-11-07 10:42:33 +10:00
parent 5040ecbfea
commit 5f7f3adccd

View file

@ -534,6 +534,11 @@ module ActionDispatch
scope(:constraints => constraints) { yield }
end
# Allows you to set default parameters for a route, such as this:
# defaults :id => 'home' do
# match 'scoped_pages/(:id)', :to => 'pages#show'
# end
# Using this, the +:id+ parameter here will default to 'home'.
def defaults(defaults = {})
scope(:defaults => defaults) { yield }
end