Well, you better agree. Otherwise, you will be kicked out!
Here is the rails way to enforce this:
Model side:
RHTML side:
<%form_for :user, @user, :url => users_path do f %>
<p>
... other controls ...
</p>
<p>
<%= f.check_box :terms_of_service %>
I accept the terms of service.
</p> <p>
<%= submit_tag "Save" %>
</p>
<% end %>
The :term_of_service is actually virtual. It has not direct value in database. ActiveRecord temperately hold it in memory.
No comments:
Post a Comment