如何在HAML中写这个?
<a class="pull-left" href="#">
<img class="media-object" data-src="holder.js/64x64">
</a>
我尝试了这个,但失败了:
=link_to "#", :class => "pull-left
=image_tag "64x64.gif", :class => "media-object"
答案 0 :(得分:7)
这是HAML中的正确方法(请注意do
行末尾的link_to
):
= link_to "#", :class => "pull-left" do
= image_tag "64x64.gif", :class => "media-object"