我的用户模型中有生日,我使用了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方法?