HTML 5数据属性在HAML中没有值

Gle*_*ita 4 ruby haml ruby-on-rails ruby-on-rails-3.2

当我有没有值的HTML 5数据属性时,如何在HAML中执行此操作

<p class="title" data-section-title><a href="#mypanel">Panel</a></p>
Run Code Online (Sandbox Code Playgroud)

我这样做了,但HAML引发了一个错误

%p{ class: "title", data: { section: {:title}}}= link_to "Panel", "#mypanel"
Run Code Online (Sandbox Code Playgroud)

谢谢

Cha*_*les 9

我刚刚完成了为我正在进行的项目写这篇文章.我在基础文档中找不到它.

.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
Run Code Online (Sandbox Code Playgroud)