diff options
author | Nicholas Seckar <nseckar@gmail.com> | 2005-09-11 13:45:55 +0000 |
---|---|---|
committer | Nicholas Seckar <nseckar@gmail.com> | 2005-09-11 13:45:55 +0000 |
commit | 9e5d64b3bbc9a1a4b15c4728d65dbce226ca9512 (patch) | |
tree | f02f28e25bcc6442642202921f478de74fb59081 /actionpack/lib/action_controller | |
parent | b646e0ddf7b1db3046d9d592060d7147f497cba3 (diff) | |
download | rails-9e5d64b3bbc9a1a4b15c4728d65dbce226ca9512.tar.gz rails-9e5d64b3bbc9a1a4b15c4728d65dbce226ca9512.tar.bz2 rails-9e5d64b3bbc9a1a4b15c4728d65dbce226ca9512.zip |
Provide Named Route's hash methods as helper methods. Closes #1744.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2204 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/lib/action_controller')
-rw-r--r-- | actionpack/lib/action_controller/routing.rb | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/actionpack/lib/action_controller/routing.rb b/actionpack/lib/action_controller/routing.rb index 74a0541d9e..f06a464adb 100644 --- a/actionpack/lib/action_controller/routing.rb +++ b/actionpack/lib/action_controller/routing.rb @@ -621,7 +621,9 @@ module ActionController def define_hash_access_method(route, name) hash = known_hash_for_route(route) - define_method(hash_access_name(name)) { hash } + define_method(hash_access_name(name)) do |*args| + args.first ? hash.merge(args.first) : hash + end end def name_route(route, name) @@ -634,6 +636,7 @@ module ActionController protected url_helper_name(name), hash_access_name(name) Helpers << url_helper_name(name).to_sym + Helpers << hash_access_name(name).to_sym Helpers.uniq! end |