How do I wrap span tags in a link_to in slim?

Aen Tan picture Aen Tan · Apr 13, 2013 · Viewed 12.6k times · Source
li = link_to 'Account', '#account', data: { toggle: 'tab' }

I need span tags around 'Account'.

Answer

stringsn88keys picture stringsn88keys · Apr 13, 2013

You can also use a block if you find that you have more complex code inside the link text than just a span tag:

   li = link_to '#account', data: {toggle: 'tab'} do
     span
       = "Account"