I am writing Ruby code, not Rails, and I need to handle something like this:
found 1 match found 2 matches
I have Rails installed, maybe I can add a require clause at the top of the script, but does anyone know of a RUBY method that pluralizes strings? Is there a class that I can require to handle this if the script is not Rails but I have Rails installed?
Edit: All of these answers were close, but I checked the one that worked for me. Try this method as an aid to writing Ruby, not Rails, code:
def pluralize(number, text) return text.pluralize if number != 1 text end
ruby require pluralize
DJTripleThreat Mar 15 2018-10-15T00: 00Z
source share