The expected HTML
result is as follows:
<li>description1 name1</li>
<li>description2 name2</li>
<!-- ... -->
Where the list of description
-name
is known and can be iterated over.
I tried to do:
li
= tool.description
|
= tool.name
or
li
= "#{tool.description} #{tool.name}"
but it seems like an ugly way to achieve that.
Is there any other and elegant solution?
You can use interpolation directly in both Slim and Haml, so you don’t need to use =
and quote the whole string.
In Slim, you could do:
li #{tool.description} #{tool.name}
and in Haml the only difference is you just need to add the lead %
:
%li #{tool.description} #{tool.name}