Hi Daniel.
Thanks very much for the response. The fact that they are precompiled at deployment might explain why I have been finding it excruciatingly hard to figure this out.
If I went with the approach of adding a JS block into my html.erb file, it would be slower, I suspect. But would it mean that all my helpers in rubyland are now namespace visible? Now if I do this, wouldn't I have to move the js file in question out of the folder that application.js is including all js files from?
My second question is probably more important. The logic needed in the helper that I need in this js file is logic that is available right at precompilation time. I know that .js.erb files can in fact use helpers, so how does that work? Are these limited to js.erb files that are not precompiled, or can precompiled ones also include "special" helpers that are "executed" at precompilation time? Ideally, application.js is precompiled and this helper is run at precompilation. If that's possible.
Thanks!