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