From 4d5b913fcf73b352f5a426c862dbeb483d67a9a3 Mon Sep 17 00:00:00 2001 From: Jeremy Kemper Date: Sun, 5 Nov 2006 05:04:21 +0000 Subject: pluralize helper interprets nil as zero. Closes #6474. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5431 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- actionpack/lib/action_view/helpers/text_helper.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'actionpack/lib') diff --git a/actionpack/lib/action_view/helpers/text_helper.rb b/actionpack/lib/action_view/helpers/text_helper.rb index f1d67c53bb..c5b757d6e1 100644 --- a/actionpack/lib/action_view/helpers/text_helper.rb +++ b/actionpack/lib/action_view/helpers/text_helper.rb @@ -85,7 +85,7 @@ module ActionView # pluralize(2, 'person') => 2 people # pluralize(3, 'person', 'users') => 3 users def pluralize(count, singular, plural = nil) - "#{count} " + if count == 1 || count == '1' + "#{count || 0} " + if count == 1 || count == '1' singular elsif plural plural -- cgit v1.2.3