From 3108764367023aabaee04d1dbcbed8eb76e61184 Mon Sep 17 00:00:00 2001 From: Nicholas Seckar Date: Tue, 6 Sep 2005 22:06:11 +0000 Subject: Fix overwrite params. Closes #1909 git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2144 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- actionpack/lib/action_controller/url_rewriter.rb | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'actionpack/lib/action_controller') diff --git a/actionpack/lib/action_controller/url_rewriter.rb b/actionpack/lib/action_controller/url_rewriter.rb index 7d66cf1ced..acad0b7b8c 100644 --- a/actionpack/lib/action_controller/url_rewriter.rb +++ b/actionpack/lib/action_controller/url_rewriter.rb @@ -36,6 +36,10 @@ module ActionController def rewrite_path(options) options = options.symbolize_keys options.update(options[:params].symbolize_keys) if options[:params] + if (overwrite = options.delete(:overwrite_params)) + options.update(@parameters) + options.update(overwrite) + end RESERVED_OPTIONS.each {|k| options.delete k} path, extra_keys = Routing::Routes.generate(options.dup, @request) # Warning: Routes will mutate and violate the options hash -- cgit v1.2.3