Forget defaults :action if :controller changed at all

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@641 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
上级 29066036
......@@ -224,7 +224,7 @@ def expand_controller_path!(options, defaults)
else
relative_to = defaults[:controller] ? defaults[:controller].split('/')[0..-2].join('/') : ''
options[:controller] = relative_to.empty? ? options[:controller] : "#{relative_to}/#{options[:controller]}"
defaults.delete(:action) unless options[:controller] == defaults[:controller]
defaults.delete(:action) if options.key?(:controller)
end
else
options[:controller] = defaults[:controller]
......@@ -256,6 +256,6 @@ def self.draw(*args, &block)
end
Routes = RouteSet.new
#Routes.reload # Do this here, so that server will die on load if SyntaxError or whatnot.
Routes.reload # Server will die on load if SyntaxError
end
end
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册