簡體   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