是否可以添加< option>在< select>的结尾处用collection_select帮助程序创建?
现在我有@H_301_3@
f.collection_select(:category_id,@categories,:id,:name,{:prompt => 'Please select a category'})
它产生@H_301_3@
<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>
我想要的是@H_301_3@
<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>