Interpolate inside html attributes with Underscore.js

后端 未结 3 985
自闭症患者
自闭症患者 2021-01-12 16:40

I\'m building an application using Backbone.js, Underscore.js, HAML, and Coffeescript.

The problem I\'m having is getting variables to interpolate inside of html ele

3条回答
  •  佛祖请我去吃肉
    2021-01-12 17:13

    The solution to this problem is to use HAML's :escape_attrs option.

    Haml::Engine.new(template, :escape_attrs => false).render
    

提交回复
热议问题