aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_controller
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/lib/action_controller')
-rw-r--r--actionpack/lib/action_controller/routing.rb5
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