HTML 5 Data Attributes Without Value in HAML

How to do this in HAML when I have HTML 5 data attributes without value

<p class="title" data-section-title><a href="#mypanel">Panel</a></p> 

I did this, but HAML is throwing an error

 %p{ class: "title", data: { section: {:title}}}= link_to "Panel", "#mypanel" 

thanks

+4
source share
1 answer

I just finished writing this for a project I'm working on. I could not find it in the foundation documents.

 .large-12.columns .section-container.auto{:data => {'section' => true}} %section %p.title{:data => {'section-title' => true}} %a{:href=>"#panel1" } Section 1 .content{:data => {'section-content' => true}} %p Content of section 1 %section %p.title{:data => {'section-title' => true}} %a{:href=>"#panel2" } Section 2 .content{:data => {'section-content' => true}} %p Content of section 2 
+8
source

Source: https://habr.com/ru/post/1493986/


All Articles