我正在尝试使用selectbox更新模型:
f.select :currency, options_for_select([["please select", ""], "DKR", "SEK", "EURO"]), :selected => :currency
我尝试过select_tag
、select
等的不同变体。
然而,这不起作用,但当我使用text_field
时,属性会被保存到数据库中:
f.text_field :currency
这可能是什么原因?
您需要说明每个名称的值:
["DKR", "dkr"], ["SEK", "sek"]
等`