【发布时间】:2016-03-13 21:47:53
【问题描述】:
如何使用 ruby 添加粗体标题(又名 optgroup) 和 select2?
<%= @challenge.select(:name, [[], ['optgroup label: Mind'], ['Write a Book'], ['Paint a Picture'], ['optgroup label: Body'], ['Run a 5K'], ['Lose 10 Pounds']]) %>
$('select').select2({
placeholder: "Enter Challenge",
theme: "bootstrap",
allowClear: false,
tags: true,
multiple: false,
});
我很难将此处提供的答案转换为红宝石解决方案:Select2 - How to insert a bolded headline?
【问题讨论】:
标签: ruby-on-rails ruby jquery-select2 ui-select2 select2-rails