我有这样的任务:当用户编辑他的对象时 - 列表中的第一个选项将是对象的值。
我正在使用以下代码生成我的选择列表:
<%= f.select :category, options_for_select([
"#{@website.category}",
"Banking",
"Computers",
"Coupons",
"Directory",
"Fashion",
"Finance",
"Gifts",
"Maps",
"Media",
"Mobile",
"News",
"Tickets",
"Tech blog",
"Tech website",
"Trains",
"Travel",
"Transportation - general",
"Recipes",
"Another... "])%>
谁能建议怎么做?