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

瘦欲@ 提交于 2019-12-04 03:03:06
li = link_to content_tag(:span, 'Account'), '#account', data: { toggle: 'tab' }

http://api.rubyonrails.org/classes/ActionView/Helpers/TagHelper.html#method-i-tag

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"
li = link_to "<span>Account</span>".html_safe, '#account', data: { toggle: 'tab' }
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!