Permalink
Browse files

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

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4381 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
1 parent cc88679 commit 4a98cbe2ddfaaf1b81b18d56d9909cef942ae96e @dhh dhh committed May 31, 2006
Showing with 1 addition and 1 deletion.
  1. +1 −1 actionpack/lib/action_controller/routing.rb
@@ -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)

0 comments on commit 4a98cbe

Please sign in to comment.