如何编写提示以设置默认 select 选项

How to write prompt to set default select option

我想在此处将默认 select 选项显示为 "select Size"。如何给它这个 select 选项?

感谢任何帮助。

这是我的瘦身档案:

= select_tag "standard_size_id", 
    options_from_collection_for_select(@standard_sizes, "id", "name"), include_blank: true, class: 'form-control'

您可以尝试这种方式,只需添加 prompt 属性并删除 include_blank

<%= select_tag "standard_size_id", options_from_collection_for_select(@standard_sizes, "id", "name"), class: 'form-control', prompt: 'Select Size' %>