我有以下代码:
<% form_for(@libation) do |f| %>
<%= f.radio_button :carbonated, true %> <%= f.label :carbonated, "Yes" %>
<%= f.radio_button :carbonated, false %> <%= f.label :carbonated, "No" %>
<% end %>
数据库中的carbonated
列是类型tinyint
。
当上面运行并单击时,No
我会看到一个大红框告诉我:
1 error prohibited this libation from being saved
There were problems with the following fields:
* Carbonated can't be blank
有任何想法吗?
-谢谢