How to use the “number_to_currency” helper method in the model rather than view?

I agree with all of you that this could be breaking the MVC pattern but there is always reasons to break a pattern, in my case I needed these currency formatter methods to use them in a template filter (Liquid in my case).

At the end I found out I could access to these currency formatter methods using things like this:

ActionController::Base.helpers.number_to_currency

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)