method
normalize_options!
v3.0.0 -
Show latest stable
- Class:
ActionDispatch::Routing::Mapper::Mapping
normalize_options!()private
No documentation available.
# File actionpack/lib/action_dispatch/routing/mapper.rb, line 59
def normalize_options!
path_without_format = @path.sub(/\(\.:format\)$/, '')
if using_match_shorthand?(path_without_format, @options)
to_shorthand = @options[:to].blank?
@options[:to] ||= path_without_format[1..-1].sub(%r{/([^/]*)$}, '#\1')
@options[:as] ||= Mapper.normalize_name(path_without_format)
end
@options.merge!(default_controller_and_action(to_shorthand))
end