diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2006-05-31 04:48:46 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2006-05-31 04:48:46 +0000 |
commit | 4a98cbe2ddfaaf1b81b18d56d9909cef942ae96e (patch) | |
tree | facd8812ee37ce64345387275527ea56cc5a7a40 | |
parent | cc88679c0c20d05f0fef2b9f8e38547ed8facbc4 (diff) | |
download | rails-4a98cbe2ddfaaf1b81b18d56d9909cef942ae96e.tar.gz rails-4a98cbe2ddfaaf1b81b18d56d9909cef942ae96e.tar.bz2 rails-4a98cbe2ddfaaf1b81b18d56d9909cef942ae96e.zip |
If not passing a hash, assume :id => whatever
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4381 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
-rw-r--r-- | actionpack/lib/action_controller/routing.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/actionpack/lib/action_controller/routing.rb b/actionpack/lib/action_controller/routing.rb index f52b78cc75..67339a6f21 100644 --- a/actionpack/lib/action_controller/routing.rb +++ b/actionpack/lib/action_controller/routing.rb @@ -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) |