Most rails 3.1 tutorials regarding the asset pipeline and javascript templating lead me to believe that the asset pipeline will pick up any *.jst files and slap them into a JST variable that’s available to your *.js files. However, I’m currently stumped with the following error when I try to load a *.jst template:
Uncaught ReferenceError: JST is not defined
Any pointers?
The JST variable seems to get set if you correctly include the javascript template items in your
app/assets/application.jsfile so they can be included via the asset pipeline://= require templates/your_template.jst
Then include the javascript template in your corresponding rails views (using haml):