使用rails添加跨度到bootstrap标签?

时间:2016-03-02 19:55:36

标签: ruby-on-rails twitter-bootstrap bootstrap-form-helper

如何在使用bootstrap form rails gems生成的引导程序表单标签中添加span。

这是我迄今为止没有运气的尝试:

= 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}

由于

1 个答案:

答案 0 :(得分: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元素之前的任何原因?