diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2005-03-27 00:01:56 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2005-03-27 00:01:56 +0000 |
commit | d3e1e0305645b9de904399144b18b5d2bdf86e32 (patch) | |
tree | 323748cdf2a293a250df714c5128c72dd4bb3810 /actionpack/lib | |
parent | 8ff6d76c6a54650c0bfb1809cb3e870ebb4c2de6 (diff) | |
download | rails-d3e1e0305645b9de904399144b18b5d2bdf86e32.tar.gz rails-d3e1e0305645b9de904399144b18b5d2bdf86e32.tar.bz2 rails-d3e1e0305645b9de904399144b18b5d2bdf86e32.zip |
Added :owerwrite_params back to url_for and friends -- it was AWL since the introduction of Routes #921 [raphinou]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1016 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/lib')
-rw-r--r-- | actionpack/lib/action_controller/url_rewriter.rb | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/actionpack/lib/action_controller/url_rewriter.rb b/actionpack/lib/action_controller/url_rewriter.rb index 6474c72306..6d7c99eff0 100644 --- a/actionpack/lib/action_controller/url_rewriter.rb +++ b/actionpack/lib/action_controller/url_rewriter.rb @@ -35,8 +35,15 @@ module ActionController options = options.symbolize_keys options.update((options[:params] || {}).symbolize_keys) RESERVED_OPTIONS.each {|k| options.delete k} - path, extras = Routing::Routes.generate(options, @request) + + if extras[:overwrite_params] + params_copy = @request.parameters.delete_if { |k,v| ["controller","action"].include? k } + params_copy.update extras[:overwrite_params] + extras.delete(:overwrite_params) + extras.update(params_copy) + end + path = "/#{path.join('/')}".chomp '/' path = '/' if path.empty? path += build_query_string(extras) |