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

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4381 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
David Heinemeier Hansson
2006-05-31 04:48:46 +00:00
parent cc88679c0c
commit 4a98cbe2dd

View File

@@ -713,7 +713,7 @@ module ActionController
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)