Search code examples
ruby-on-railspluralize

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


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


Solution

  • Rather than extend things, I just it like this:

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

    Hope this helps someone else!