Notes posted by singsai
RSS feed
0 thanks
Minor edit of pluralize_without_count
patrickberkeley’s method works great. I corrected the grammar a bit for inflection (the singular error).
application_helper.rb
def pluralize_without_count(count, noun, text = nil) if count != 0 count == 1 ? "an #{noun}#{text}" : "#{noun.pluralize}#{text}" end end
This should work in much older versions of Rails also.