Before upgrading to rails 5 I had include Gon::GonHelpers
in my model file. Now I get an error and I am not able to use the gon
variable in my model.
I get the error message:
NameError: undefined local variable or method `gon' for ....
How can I get to use gon in my model? I have found many answers on how to include it in views and controller, but not in models. Thank you!
Adding:
include Gon::ControllerHelpers
seems to solve the problem