gpt4 book ai didi

css - rails : How to add "style=" in grouped_select in simple form

转载 作者:行者123 更新时间:2023-11-28 15:19:56 25 4
gpt4 key购买 nike

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

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

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

我的看法如下。

    <%= 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'",但没有成功。

最佳答案

input_html: { style: "font-family: FontAwesome,arial" }

关于css - rails : How to add "style=" in grouped_select in simple form,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36789282/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com