instance method
defaults
Ruby on Rails 3.1.12
Since v3.0.20Signature
defaults(defaults = {})
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’.
Parameters
-
defaultsopt = {}
Source
# File actionpack/lib/action_dispatch/routing/mapper.rb, line 767
def defaults(defaults = {})
scope(:defaults => defaults) { yield }
end
Defined in actionpack/lib/action_dispatch/routing/mapper.rb line 767
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActionDispatch::Routing::Mapper::Scoping