Is there a way to use pluralize() inside a model rather than a view?

jpw picture jpw · Jul 24, 2011 · Viewed 12.2k times · Source

It seems pluralize only works within a view -- is there some way that my models can use pluralize too?

Answer

Tom Rossi picture Tom Rossi · Sep 28, 2013

Rather than extend things, I just it like this:

ActionController::Base.helpers.pluralize(count, 'mystring')

Hope this helps someone else!