While I realize you are supposed to use a helper inside a view, I need a helper in my controller as I\'m building a JSON object to return.
It goes a little like this:
In Rails 5 use the helpers.helper_function in your controller.
Example:
def update
# ...
redirect_to root_url, notice: "Updated #{helpers.pluralize(count, 'record')}"
end
Source: From a comment by @Markus on a different answer. I felt his answer deserved it's own answer since it's the cleanest and easier solution.
Reference: https://github.com/rails/rails/pull/24866