aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack')
-rw-r--r--actionpack/CHANGELOG2
-rw-r--r--actionpack/lib/action_controller/url_rewriter.rb9
2 files changed, 10 insertions, 1 deletions
diff --git a/actionpack/CHANGELOG b/actionpack/CHANGELOG
index 5519505526..c5f42e51be 100644
--- a/actionpack/CHANGELOG
+++ b/actionpack/CHANGELOG
@@ -1,5 +1,7 @@
*SVN*
+* Added :owerwrite_params back to url_for and friends -- it was AWL since the introduction of Routes #921 [raphinou]
+
* Added :position option to link_to_remote/form_remote_tag that can be either :before, :top, :bottom, or :after and specifies where the return from the method should be inserted #952 [Matthew McCray/Sam Stephenson]
* Added Effect.Highlight to prototype.js to do Yellow Fade Technique (of 37signals' fame) on any container #952 [Sam Stephenson/?]
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)