我想要下拉菜单中的占位符文本(预定义的一个“选择任何状态”)。以下是我的下拉菜单代码
<%= f.select :status,[[],['Created','Created'],['Deleted','Deleted'],
['Modified','Modified'],['Stored','Stored'],['Trained/Broken','Trained/Broken'],
['Unnecessary','Unnecessary']] %>
红宝石:1.9.3 Rails 3.2.13
提前致谢
答案 0 :(得分:3)
您可以使用prompt
:
<%= f.select :status,[[],['Created','Created'],['Deleted','Deleted'],
['Modified','Modified'],['Stored','Stored'],['Trained/Broken','Trained/Broken'],
['Unnecessary','Unnecessary']], prompt: "Please Select" %>