Search code examples
javascripthtmlbackbone.jsjst

rendering image in Backbone JST template


I have images stored in my app/assets/images directory, and from my JST templates (rendered by my Backbone view) I am trying to figure out how to get the image asset path. src='assets/images/image.png' does not work. Any ideas?

Thanks


Solution

  • Are you using rails as your backend? Then in your template file it should be:

    <img src="/assets/image">
    

    The path to retrieve assets starts with /