I’m looking to check if a string is all capitals in Rails.
How would I go about doing that?
I’m writing my own custom pluralize helper method and I would something be passing words like “WORD” and sometimes “Word” – I want to test if my word is all caps so I can return “WORDS” – with a capital “S” in the end if the word is plural (vs. “WORDs”).
Thanks!
Do this:
E.g:
Hence the code for your scenario will be: