From 00db6f0faae6d53b7190981561beb6da0450359b Mon Sep 17 00:00:00 2001 From: Jamis Buck Date: Mon, 30 May 2005 07:20:37 +0000 Subject: render(:partial => "...") uses an empty hash for the local assigns #1365. render(:partial => true) is identical to the older render_partial() git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1366 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- actionpack/CHANGELOG | 8 +++++++- actionpack/lib/action_controller/base.rb | 9 +++++++-- actionpack/test/controller/new_render_test.rb | 4 ++-- 3 files changed, 16 insertions(+), 5 deletions(-) (limited to 'actionpack') diff --git a/actionpack/CHANGELOG b/actionpack/CHANGELOG index 424847e8cf..712f4b4589 100644 --- a/actionpack/CHANGELOG +++ b/actionpack/CHANGELOG @@ -1,5 +1,11 @@ *SVN* +* render(:partial => true) is identical to the behavior of the deprecated render_partial() + +* Fixed render(:partial => "...") to use an empty Hash for the local assigns #1365 + +* Fixed Caching::Fragments::FileStore.delete to not raise an exception if the delete fails. + * Deprecated all render_* methods in favor of consolidating all rendering behavior in Base#render(options). This enables more natural use of combining options, such as layouts. Examples: +---------------------------------------------------------------+-------------------------------------------------------+ @@ -1574,4 +1580,4 @@ *0.7.5* -* First public release \ No newline at end of file +* First public release diff --git a/actionpack/lib/action_controller/base.rb b/actionpack/lib/action_controller/base.rb index aad581b8e7..0e2f87b468 100755 --- a/actionpack/lib/action_controller/base.rb +++ b/actionpack/lib/action_controller/base.rb @@ -473,13 +473,18 @@ module ActionController #:nodoc: render(options.merge({ :text => ( @template.render_partial_collection( - options[:partial], options[:collection], options[:spacer_template], options[:locals] + options[:partial] == true ? default_template_name : options[:partial], + options[:collection], options[:spacer_template], + options[:locals] || {} ) || '' ) })) elsif options[:partial] - render(options.merge({ :text => @template.render_partial(options[:partial], options[:object], options[:locals]) })) + render(options.merge({ :text => @template.render_partial( + options[:partial] == true ? default_template_name : options[:partial], + options[:object], options[:locals] || {} + ) })) elsif options[:nothing] render(options.merge({ :text => "" })) diff --git a/actionpack/test/controller/new_render_test.rb b/actionpack/test/controller/new_render_test.rb index 428b7dc73b..ad1415aca3 100644 --- a/actionpack/test/controller/new_render_test.rb +++ b/actionpack/test/controller/new_render_test.rb @@ -72,7 +72,7 @@ class TestController < ActionController::Base end def partial_only - render_partial + render :partial => true end def hello_in_a_string @@ -238,4 +238,4 @@ class RenderTest < Test::Unit::TestCase def process_request TestController.process(@request, @response) end -end \ No newline at end of file +end -- cgit v1.2.3