示例模板:
%input{ @attributes }
示例渲染:
@attributes = {:foo => :bar}
render :example_template
带有haml的示例输出:
<input foo="bar">
我试图用 haml-coffe 来实现这一点,JST['example_template']({attributes: {foo: 'bar'}}
但它似乎不像我预期的那样工作。
如何使用haml-coffee 完全动态地赋予所有属性?