simple_form以表单字段的名称创建括号

时间:2013-02-08 23:38:07

标签: ruby-on-rails-3 simple-form

我的用户模型中有生日,我使用了simple_form用于生日的示例:

<%= f.label "When is your birthday?" %>
<%= f.input :birthday, as: :date, start_year: Date.today.year - 60,
                      end_year: Date.today.year, order: [:month, :day, :year], label: false %>

这会创建名称birthday(1i),birthday(2i),birthday(3i),然后导致此质量分配错误:

Can't mass-assign protected attributes: birthday(2i), birthday(3i), birthday(1i)

现在如何将带括号的符号名称添加到attr_accessible方法?

0 个答案:

没有答案