method
normalize_options!
v4.1.8 -
Show latest stable
- Class:
ActionDispatch::Routing::RouteSet::Generator
normalize_options!()public
No documentation available.
# File actionpack/lib/action_dispatch/routing/route_set.rb, line 542
def normalize_options!
# If an explicit :controller was given, always make :action explicit
# too, so that action expiry works as expected for things like
#
# generate({controller: 'content'}, {controller: 'content', action: 'show'})
#
# (the above is from the unit tests). In the above case, because the
# controller was explicitly given, but no action, the action is implied to
# be "index", not the recalled action of "show".
if options[:controller]
options[:action] ||= 'index'
options[:controller] = options[:controller].to_s
end
if options.key?(:action)
options[:action] = (options[:action] || 'index').to_s
end
end