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:
parent
5040ecbfea
commit
5f7f3adccd
1 changed files with 5 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue