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