0
我试图做到这一点,并建立使用中间人应用与把手
%script{:type => "text/html", :id => "showItem"}
{{#items}}
%li
%a{href: "#{{id}}"} {{showName}}
{{/items}}
问题中间人应用Haml的语法错误是此行%a{href: "#{{id}}"}
当{{id}}
里面另一个{}
以下是错误
SyntaxError at /show.html
/show.haml:110: syntax error, unexpected '}', expecting tASSOC ...tributes({}, nil, href: "#{{id}}")}>{{showName}}</a>\n ... ...^/show.haml:127: syntax error, unexpected ',', expecting '}' ...script>\n </body>\n</html>\n", -2, false); ...^/show.haml:131: syntax error, unexpected keyword_end, expecting '}'
Ruby C:/Ruby193/lib/ruby/gems/1.9.1/gems/tilt-1.3.3/lib/tilt/template.rb: in instance_eval, line 209
Web GET localhost/show.html
有没有办法解决这个问题?因为我需要使用Handlebars解析标签属性中的变量。
谢谢。