If not passing a hash, assume :id => whatever

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4381 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
上级 cc88679c
......@@ -713,7 +713,7 @@ def name_route(route, name)
define_hash_access_method(route, name)
module_eval(%{def #{url_helper_name name}(options = {})
url_for(#{hash_access_name(name)}.merge(options))
url_for(#{hash_access_name(name)}.merge(options.is_a?(Hash) ? options : { :id => options }))
end}, "generated/routing/named_routes/#{name}.rb")
protected url_helper_name(name), hash_access_name(name)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册