我想在我的表单中添加简单的术语验证器:
模型
attr_accessor :terms
validates :terms, :acceptance => {:accept => true}, :allow_nil => false
查看(simple_form)
= simple_form_for @student, html: { multipart: true } do |f|
...
= f.input :terms, as: :select
= f.button :submit
但我得到:
Can't mass-assign protected attributes: terms
我做错了什么?