This method is deprecated or moved on the latest stable version.
The last existing version (v2.3.8) is shown here.
assign_default_route_options(segments)
public
Assign default options, such as ‘index’ as a default for
:action. This method must be run after user supplied
requirements and defaults have been applied to the segments.
# File actionpack/lib/action_controller/routing/builder.rb, line 120
def assign_default_route_options(segments)
segments.each do |segment|
next unless segment.is_a? DynamicSegment
case segment.key
when :action
if segment.regexp.nil? || segment.regexp.match('index').to_s == 'index'
segment.default ||= 'index'
segment.is_optional = true
end
when :id
if segment.default.nil? && segment.regexp.nil? || segment.regexp =~ ''
segment.is_optional = true
end
end
end
end