diff options
author | Ryan Bigg <radarlistener@gmail.com> | 2010-11-07 10:42:33 +1000 |
---|---|---|
committer | Ryan Bigg <radarlistener@gmail.com> | 2010-11-07 11:39:57 +1000 |
commit | 5f7f3adccd2ddc1d307e4e5ea4a323562b1cf7ff (patch) | |
tree | d83e15b43fa27e53af4e9293e6b2f77863e27230 /actionpack/lib/action_dispatch/routing | |
parent | 5040ecbfea931ba20439c7e84f2bdf261edd2732 (diff) | |
download | rails-5f7f3adccd2ddc1d307e4e5ea4a323562b1cf7ff.tar.gz rails-5f7f3adccd2ddc1d307e4e5ea4a323562b1cf7ff.tar.bz2 rails-5f7f3adccd2ddc1d307e4e5ea4a323562b1cf7ff.zip |
Document the defaults method
Diffstat (limited to 'actionpack/lib/action_dispatch/routing')
-rw-r--r-- | actionpack/lib/action_dispatch/routing/mapper.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/actionpack/lib/action_dispatch/routing/mapper.rb b/actionpack/lib/action_dispatch/routing/mapper.rb index 9ff7481c1f..e760eb0196 100644 --- a/actionpack/lib/action_dispatch/routing/mapper.rb +++ b/actionpack/lib/action_dispatch/routing/mapper.rb @@ -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 |