我想在此处将默认选择选项显示为“选择尺寸”。如何给它这个选择选项?
感谢任何帮助。
这是我的苗条文件:
= select_tag "standard_size_id",
options_from_collection_for_select(@standard_sizes, "id", "name"), include_blank: true, class: 'form-control'
答案 0 :(得分:1)
您可以尝试这种方式添加prompt
属性并移除include_blank
<%= select_tag "standard_size_id", options_from_collection_for_select(@standard_sizes, "id", "name"), class: 'form-control', prompt: 'Select Size' %>