Rails:如何添加" style ="在groups_select中以简单的形式

时间:2016-04-22 08:55:15

标签: css ruby-on-rails ruby-on-rails-4 simple-form font-awesome

我想在选择列表中添加style=,如下所示;

<select style="font-family:'FontAwesome', 'arial'">

我以简单的形式使用grouped_select。 如果您能告诉我如何在选择列表中设置style,将不胜感激。

我的观点如下。

    <%= f.simple_fields_for :days, @days do |d| %>

        <%= d.simple_fields_for :events do |e| %>

          <span class="form-inline">
            <p>
              <%= e.input :category, 
                :as => :grouped_select, 
                collection: [["Transportation", [["bus", 1], ["taxi", 2], ["train", 3], ["plane", 4] , ["ship", 5], ["bicycle", 6]]],["Eat/Drink", [["meal", 11], ["tea/cafe", 12]]]], 
                :group_method => :last, 
                label: false 
              %>
            </p>
          </span>
          <%= e.input :title, label: false %>

        <% end %>
      </div>

    <% end %>

虽然我尝试添加:stlye => "font-family:'FontAwesome', 'arial'",但它没有用。

1 个答案:

答案 0 :(得分:-1)

input_html:{style:“font-family:FontAwesome,arial”}