如何添加粗体标题(又名optgroup)
使用select2
ruby?
<%= @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 - 如何插入粗体标题?