From 36f69c71fe615e80a173cd5584735a82bc1dbc58 Mon Sep 17 00:00:00 2001 From: Sam Ruby Date: Wed, 10 Mar 2010 10:04:54 -0500 Subject: [PATCH 523/523] Add deprecation warning for overwrite_params and remove rdoc --- actionpack/lib/action_controller/base.rb | 9 --------- actionpack/lib/action_controller/url_rewriter.rb | 2 ++ 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/actionpack/lib/action_controller/base.rb b/actionpack/lib/action_controller/base.rb index 4a6629b..62f4395 100644 --- a/actionpack/lib/action_controller/base.rb +++ b/actionpack/lib/action_controller/base.rb @@ -616,15 +616,6 @@ module ActionController #:nodoc: # displayed on: # # url_for :controller => 'posts', :action => nil - # - # If you explicitly want to create a URL that's almost the same as the current URL, you can do so using the - # :overwrite_params options. Say for your posts you have different views for showing and printing them. - # Then, in the show view, you get the URL for the print view like this - # - # url_for :overwrite_params => { :action => 'print' } - # - # This takes the current URL as is and only exchanges the action. In contrast, url_for :action => 'print' - # would have slashed-off the path components after the changed action. def url_for(options = {}) options ||= {} case options diff --git a/actionpack/lib/action_controller/url_rewriter.rb b/actionpack/lib/action_controller/url_rewriter.rb index e4c2a29..518d767 100644 --- a/actionpack/lib/action_controller/url_rewriter.rb +++ b/actionpack/lib/action_controller/url_rewriter.rb @@ -195,6 +195,8 @@ module ActionController options.update(options[:params].symbolize_keys) if options[:params] if (overwrite = options.delete(:overwrite_params)) + ActiveSupport::Deprecation.warn ':overwrite_params is deprecated, ' << + 'specify all the necessary parameters instead', caller options.update(@parameters.symbolize_keys) options.update(overwrite.symbolize_keys) end -- 1.6.3.3