Rails / HAML: image_tag inside link_to helper

How to write it in HAML?

<a class="pull-left" href="#"> <img class="media-object" data-src="holder.js/64x64"> </a> 

I tried this, but this failed:

 =link_to "#", :class => "pull-left =image_tag "64x64.gif", :class => "media-object" 
+4
source share
1 answer

This is the correct path in HAML (note the do at the end of the link_to line):

 = link_to "#", :class => "pull-left" do = image_tag "64x64.gif", :class => "media-object" 
+7
source

Source: https://habr.com/ru/post/1492834/


All Articles