2016-03-02 40 views
0

如何添加跨度到使用引導窗體軌道寶石生成的引導窗體標籤。使用導軌添加跨度到自舉標籤?

這是我一直沒有運氣到目前爲止已經試過:

= bootstrap_form_for resource, url: wizard_path, method: :put, layout: :horizontal do |form| 

= form.select :cover_type, form.object.cover_types, {include_blank: true, label: "Cover Type <span class=fa fa-question-circle hidden-lg hidden-md></span>".html_safe} 

感謝

回答

0

這有什麼問題呢?

= bootstrap_form_for resource, url: wizard_path, method: :put, layout: :horizontal do |form| 
    = form.label 
    Cover Type 
    %span.fa.fa-question-circle.hidden-lg.hidden-md 
    = form.select :cover_type, form.object.cover_types, {include_blank: true} 

任何原因,你不會只是把標籤放在select元素之前?

+0

這不正確的語法? – Robbo

+0

縮進在某處,我目前無法爲您測試。 。 。嘗試在'= form.label'行之後修改行的間距。也許檢查haml文檔。 – Ecnalyr