KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I am writing some Ruby code, not Rails, and I need to handle something like this: found 1 match found 2 matches I have Rails installed so maybe I might be able to 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 I can require that can deal with this if the script isn't Rails but I have Rails installed? Edit: All of these answers were close but I checked off the one that got it working for me. Try this method as a helper when writing Ruby, not Rails, code: def pluralize(number, text) return text.pluralize if number != 1 text end
Tags (comma-separated)
Save Edits
Cancel