Pluralize Without Count

patrickberkeley Sep 14, 2009 6 thanks

Helper method that returns the word without the count.

==== application_helper.rb def pluralize_without_count(count, noun, text = nil) if count != 0 count == 1 ? "#{noun}#{text}" : "#{noun.pluralize}#{text}" end end

Example usage:

==== _form.html.erb <%= pluralize_withou...