I am having some trouble accessing a method “foo” I defined in a
I was under the impression that if “foo” is in the controller that
bar.html.erb, then bar.html.erb can in fact see a method in this
provided I put the “helper_method: foo” notation in the controller. I
able to verify that foo was in fact accessible in the bar.html.erb file.
The problem is I want to access foo in alpha.js.erb. My application.js
includes alpha.js (alpha.js.erb) implicitely because alpha.js.erb is in
But alpha.js.erb cannot see foo. I have no idea how to get my custom
functions to become accessible in the js files.
Would appreciate help. I scoured google for a few hours already and
not find much on this.