我想要以haml显示以下文字。
<div class="myclass">
My long text here. My word's ...
<img src="link" class="mylinkclass">
</div>
注意单词中的'
。我尝试了很多这样的事情并花了几个小时。
%li.event.right
.header= l("'EGR Operator Award for Financial Betting Operator'")
.event-body!= l(" My long text's . %img{:class => "responsive" :src => url_for("images/pages/img.jpg")} ")
上述代码失败。我试过了
%li.event.right
.header= l("'EGR Operator Award for Financial Betting Operator'")
.event-body!= l(" My long text's . <img class ="responsive" src => url_for("images/pages/img.jpg") ")
在这种情况下,url_for无法识别。请问我该如何实现?任何帮助将不胜感激。
答案 0 :(得分:1)
请试试这个:
%li.event.right
.header= l("'EGR Operator Award for Financial Betting Operator'")
.event-body
= l(" My long text's")
%img{:class => "responsive" :src => url_for("images/pages/img.jpg")}
是的,你知道这个页面吗? http://html2haml.herokuapp.com/