Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

HTML 5 Data attributes without value in HAML [duplicate]

How do I 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 have done this, but HAML raises an error

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

Thanks

like image 983
Glend Maatita Avatar asked Dec 26 '22 23:12

Glend Maatita


1 Answers

I just finished writing this out for a project I'm working on. I couldn't find it within the foundation docs.

.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
like image 143
Charles Avatar answered Jan 10 '23 20:01

Charles