使用text_field时属性更新,但不使用select或checkbox



我正在尝试使用selectbox更新模型:

f.select :currency, options_for_select([["please select", ""], "DKR", "SEK", "EURO"]), :selected => :currency

我尝试过select_tagselect等的不同变体。

然而,这不起作用,但当我使用text_field时,属性会被保存到数据库中:

 f.text_field :currency 

这可能是什么原因?

您需要说明每个名称的值:

["DKR", "dkr"], ["SEK", "sek"]等`

最新更新