method

defaults

rails latest stable - Class: ActionDispatch::Routing::Mapper::Scoping

Method deprecated or moved

This method is deprecated or moved on the latest stable version. The last existing version (v6.0.0) is shown here.

defaults(defaults = {})
public

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’.