aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_controller/base.rb
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2006-09-03 23:02:56 +0000
committerDavid Heinemeier Hansson <david@loudthinking.com>2006-09-03 23:02:56 +0000
commit5048aa9831a4ecda14eeb02f3a58157efa8f608f (patch)
tree29e5a7ea6368a87b692c16124d6f1b86ead8fef6 /actionpack/lib/action_controller/base.rb
parent315603e2be38042b7dd42cb460cd8d5cc66a0b2e (diff)
downloadrails-5048aa9831a4ecda14eeb02f3a58157efa8f608f.tar.gz
rails-5048aa9831a4ecda14eeb02f3a58157efa8f608f.tar.bz2
rails-5048aa9831a4ecda14eeb02f3a58157efa8f608f.zip
Deprecated old render parameter calls
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4947 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/lib/action_controller/base.rb')
-rwxr-xr-xactionpack/lib/action_controller/base.rb23
1 files changed, 16 insertions, 7 deletions
diff --git a/actionpack/lib/action_controller/base.rb b/actionpack/lib/action_controller/base.rb
index 1c04f5d583..7ab7845eea 100755
--- a/actionpack/lib/action_controller/base.rb
+++ b/actionpack/lib/action_controller/base.rb
@@ -490,7 +490,7 @@ module ActionController #:nodoc:
when Symbol
ActiveSupport::Deprecation.warn(
- "WARNING: You called url_for(:#{options}), which is a deprecated API. Instead you should use the named " +
+ "WARNING: You called url_for(:#{options}), which is a deprecated API call. Instead you should use the named " +
"route directly, like #{options}(). Using symbols and parameters with url_for will be removed from Rails 2.0."
)
@@ -671,12 +671,21 @@ module ActionController #:nodoc:
def render(options = nil, deprecated_status = nil, &block) #:doc:
raise DoubleRenderError, "Can only render or redirect once per action" if performed?
- # Backwards compatibility
- unless options.is_a?(Hash)
- if options == :update
- options = {:update => true}
- else
- return render_file(options || default_template_name, deprecated_status, true)
+ if options.nil?
+ return render_file(default_template_name, deprecated_status, true)
+ else
+ # Backwards compatibility
+ unless options.is_a?(Hash)
+ if options == :update
+ options = { :update => true }
+ else
+ ActiveSupport::Deprecation.warn(
+ "WARNING: You called render('#{options}'), which is a deprecated API call. Instead you use " +
+ "render :file => #{options}. Calling render with just a string will be removed from Rails 2.0."
+ )
+
+ return render_file(options, deprecated_status, true)
+ end
end
end