aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2005-04-30 08:29:50 +0000
committerDavid Heinemeier Hansson <david@loudthinking.com>2005-04-30 08:29:50 +0000
commit6d0ddd818aec1704b48fe67fd4f1e15de3dc549e (patch)
tree80e3a0d0b0bd49c6267270a779faffa18bbdd704
parent5640f76970c9b68f74df9da5cfa9763833e00d78 (diff)
downloadrails-6d0ddd818aec1704b48fe67fd4f1e15de3dc549e.tar.gz
rails-6d0ddd818aec1704b48fe67fd4f1e15de3dc549e.tar.bz2
rails-6d0ddd818aec1704b48fe67fd4f1e15de3dc549e.zip
Fixed render_partial_collection to output an empty string instead of nil when handed an empty array #1202 [Ryan Carver]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1249 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
-rw-r--r--actionpack/CHANGELOG2
-rwxr-xr-xactionpack/lib/action_controller/base.rb2
2 files changed, 3 insertions, 1 deletions
diff --git a/actionpack/CHANGELOG b/actionpack/CHANGELOG
index e1c1ef5391..ba7b22b7f7 100644
--- a/actionpack/CHANGELOG
+++ b/actionpack/CHANGELOG
@@ -1,5 +1,7 @@
*SVN*
+* Fixed render_partial_collection to output an empty string instead of nil when handed an empty array #1202 [Ryan Carver]
+
* Improved the speed of regular expression expirations for caching by a factor of 10 #1221 [Jamis Buck]
* Removed dumping of template assigns on the rescue page as it would very easily include a ton of data making page loads take seconds (and the information was rarely helpful) #1222
diff --git a/actionpack/lib/action_controller/base.rb b/actionpack/lib/action_controller/base.rb
index 15724e2e36..eebca26191 100755
--- a/actionpack/lib/action_controller/base.rb
+++ b/actionpack/lib/action_controller/base.rb
@@ -504,7 +504,7 @@ module ActionController #:nodoc:
# Renders a collection of partials using <tt>partial_name</tt> to iterate over the +collection+.
def render_partial_collection(partial_name, collection, partial_spacer_template = nil, local_assigns = {})#:doc:
add_variables_to_assigns
- render_text(@template.render_collection_of_partials(partial_name, collection, partial_spacer_template, local_assigns))
+ render_text(@template.render_collection_of_partials(partial_name, collection, partial_spacer_template, local_assigns) || '')
end
# Sends the file by streaming it 4096 bytes at a time. This way the