是否可以使用辅助方法在创建<option>的末尾添加?<select>collection_select
现在我有
f.collection_select(:category_id , @categories, :id, :name, {:prompt => 'Please select a category'})
Run Code Online (Sandbox Code Playgroud)
产生
<select id="product_category_id" name="product[category_id]">
<option value="">Please select a category</option>
<option value="7">category one</option>
<option value="8">category 2</option>
</select>
Run Code Online (Sandbox Code Playgroud)
我想要的是什么
<select id="product_category_id" name="product[category_id]">
<option value="">Please select a category</option>
<option value="7">category one</option>
<option value="8">category 2</option>
<option value="new">..or create a new one</option>
</select>
Run Code Online (Sandbox Code Playgroud)
这是可能的还是我应该循环遍历集合并手动生成选项?