Empty attribute with Ruby HAML

后端 未结 3 640
余生分开走
余生分开走 2020-12-14 06:01

I\'m implementing Schema microformats on a Ruby project using HAML and can\'t figure out how to set an empty attribute on a tag. I tried nil and false, but they simply do no

3条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-14 06:18

    The accepted answer works, but it produces an HTML attribute with value.

    If you want the attribute only to be output on HTML, without value, you can use the HTML-style attributes syntax of HAML:

    %div(itemscope)
    

提交回复
热议问题