We use the program for our members. We added the tos_agreement (boolean) field to our member schema, and we added it to views/devise/registrations/new.html.haml .
In the Member model, we have a validation rule as follows:
validates_acceptance_of :tos_agreement, :allow_nil => false, :accept => true
It works great - if you do not accept TOS, you cannot register.
However, the problem is with editing your settings. If you go to /members/edit , you will get a form in which you can change your email address or password. There is no field for a TOS agreement, since at this point it should not change. However, when you make changes (for example, change your password) and submit the form, it returns an error message that the TOS agreement cannot be false.
How can we say that we never tried to change the TOS agreement after the first registration?
Edit: so I believe that the main problem was what we had: tos_agreement in our attr_accessible, which was a very bad idea, now I think about it. But if we delete it, how do we modify Devise to accept a parameter and do something with it, even if it is not intended for mass use?
Skud
source share