Validates_acceptance_of with virtual attribute check box

I’ve scoured the web for solution, but I can’t figure out why this is
not working! I have a terms and conditions check box that user has to
check in order to register with a site, but it seems to just let user
register regardless of the check box status.

Here’s what I have:

validates_acceptance_of :terms_and_conditions, :on
=> :create, :message => “must be accepted.”
attr_accessible :terms_and_conditions

<%= form.check_box :terms_and_conditions %>

LOG: (skipping other fields with “…” to save space)
Parameters: {“action”=>“create”, …, “user”=>{… ,
“terms_and_conditions”=>“0”,… }}

I am seeing in the log (as shown above) that the
“terms_and_conditions”=>“0”, when I don’t check the box, and
“terms_and_conditions”=>“1”, when I check the box.
But either way, it just goes ahead and creates the record, and no
warning when I don’t check the box.

What am I doing wrong?

Never mind… I found out that at “save”, terms_and_conditions was not
being set and that was the problem! Everything works fine now.