繁体   English   中英

Rails中的HAML link_to在页面加载时不应用类

[英]HAML link_to in rails does not apply a class on page load

以下脚本的问题在于,以下代码仅在刷新页面后而不是在第一个页面加载期间使releases.content处于活动状态。 我刚开始编写haml模板。 我可能会在这里做任何明显错误的事情?

%li.accordion-navigation
      = link_to "Last 10 Releases", "#releases" 
      #releases.content.active
        %table.grid
          %thead
            %tr
              %th Build
              %th Deployed at
              %th Report
          %tbody
            - @last_deployments.each do |deployment|
              %tr
                %td= deployment.build
                %td= deployment.deployed_date
                %td
                  = link_to "detail", certification_path(deployment.certification)
    %li.accordion-navigation
      = link_to "Current Bug Status", "#bug_status"
      #bug_status.content.active \w

试试下面的代码,甚至相同的代码-

%div.content.active{ id: 'releases' }

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM