3

I know how to remove whitespace in HAML.

%img<
%img<
%img

But how do I get the same effect if I use ruby code?

= image_tag
= image_tag

Thanks.

Sam

Sam Kong
  • 5,472
  • 8
  • 51
  • 87
  • possible duplicate of [Haml: Control whitespace around text](http://stackoverflow.com/questions/1311428/haml-control-whitespace-around-text) – tom redfern Apr 15 '14 at 14:37

2 Answers2

5

What not just do this?

 = image_tag + image_tag

Not ideal, but you could also wrap in a span tag in order to use >

 %span>= image_tag
 %span>= image_tag
Blake Taylor
  • 9,217
  • 5
  • 38
  • 41
1

In some cases (for example, text after image) can help interpolation:

  #{image_tag 'image.png'}text
zhrivodkin
  • 71
  • 1
  • 6