maprihoda maprihoda - 2 months ago 12
Ruby Question

Nesting a text inside a tag in slim

How do I nest the

'Featured'
text inside the
a
tag, given the
span
, the text, and the other
span
are siblings?

li
a href="#" class="selected"
span class="icon-before"
Featured
span class="icon-after"

Answer
li
  a href="#" class="selected"
    span class="icon-before"
    | Featured
    span class="icon-after"

Gives:

<li><a class="selected" href="#"><span class="icon-before"></span>Featured<span class="icon-after"></span></a></li>