I would like to add simple terms validator to my form:
Model
attr_accessor :terms
validates :terms, :acceptance => {:accept => true}, :allow_nil => false
View(simple_form)
= simple_form_for @student, html: { multipart: true } do |f|
...
= f.input :terms, as: :select
= f.button :submit
But I get:
Can't mass-assign protected attributes: terms
What I am doing wrong?
You can try with:
On your view:
Regards!