Skip to content
Browse files

Added :owerwrite_params back to url_for and friends -- it was AWL sin…

…ce the introduction of Routes #921 [raphinou]

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1016 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
1 parent 8ff6d76 commit d3e1e0305645b9de904399144b18b5d2bdf86e32 @dhh dhh committed Mar 27, 2005
Showing with 10 additions and 1 deletion.
  1. +2 −0 actionpack/CHANGELOG
  2. +8 −1 actionpack/lib/action_controller/url_rewriter.rb
View
2 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/?]
View
9 actionpack/lib/action_controller/url_rewriter.rb
@@ -35,8 +35,15 @@ def rewrite_path(options)
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)

0 comments on commit d3e1e03

Please sign in to comment.
Something went wrong with that request. Please try again.