I defined my helper function in Helper:
module CarsHelper def my_helper ... end end
But I can not use it (my_helper) in my model CarsControlleror in Car, so that the user assistant can only be used in the view?
CarsController
Car
Assistants usually relate to submissions. But you can include them in your controllers. Just add
helper :cars
to your controller. ( docs )
Models are not available for assistants. Use class or instance methods instead.
A new way to use view helpers in controllers is to use: helpers.[helpername]
helpers.[helpername]
.