# Validating that a user-agreement checkbox has been checked

**URL:** <https://www.ruby-forum.com/t/validating-that-a-user-agreement-checkbox-has-been-checked/129276>\
**Category:** Rails\
**Created:** [February 16, 2008, 2:11am UTC](https://www.ruby-forum.com/t/validating-that-a-user-agreement-checkbox-has-been-checked/129276 "2008-02-16T02:11:31Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [February 16, 2008, 2:11am UTC](https://www.ruby-forum.com/t/validating-that-a-user-agreement-checkbox-has-been-checked/129276/1 "2008-02-16T02:11:31Z")

</div>

Hi,

I have a checkbox that a user must check before they register on my  
site. It is to accept the terms of use. My question is, what  
validation code do I need to add to my user model so that the record  
can’t be saved until the box is checked?

Thanks, - Dave

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [February 16, 2008, 2:18am UTC](https://www.ruby-forum.com/t/validating-that-a-user-agreement-checkbox-has-been-checked/129276/2 "2008-02-16T02:18:33Z")

</div>

On Feb 15, 2008 8:10 PM, removed\_email\_address@domain.invalid  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Hi,
> 
> I have a checkbox that a user must check before they register on my  
> site. It is to accept the terms of use. My question is, what  
> validation code do I need to add to my user model so that the record  
> can’t be saved until the box is checked?

validates\_acceptance\_of

–  
Rick DeNatale

My blog on Ruby  
[http://talklikeaduck.denhaven2.com/](http://talklikeaduck.denhaven2.com/)

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [February 16, 2008, 3:35am UTC](https://www.ruby-forum.com/t/validating-that-a-user-agreement-checkbox-has-been-checked/129276/3 "2008-02-16T03:35:19Z")

</div>

Just thought that you’ve been asking a lot of questions on the mailing  
list  
lately and here’s a few things that might help you out:

You’ll get a quicker reply from the people on [irc.freenode.net](http://irc.freenode.net)  
#rubyonrails.  
Many people from the mailing list are in here.

[http://noobkit.com](http://noobkit.com) is a great lookup site if you don’t know what a  
method  
does.

Then there’s old faithful [http://google.com](http://google.com) too.

I did try sending this to your address but I got an instant error:

This is an automatically generated Delivery Status Notification

Delivery to the following recipient failed permanently:

```
removed_email_address@domain.invalid

```

Technical details of permanent failure:  
PERM\_FAILURE: SMTP Error (state 13): 550 [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):  
invalid address

On Sat, Feb 16, 2008 at 11:40 AM, removed\_email\_address@domain.invalid \<  
removed\_email\_address@domain.invalid\> wrote:

> 

–  
Ryan B.

> **[frozenplague.net](http://www.frozenplague.net)**
>
> This domain may be for sale!

Feel free to add me to MSN and/or GTalk as this email.

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [February 17, 2008, 12:19am UTC](https://www.ruby-forum.com/t/validating-that-a-user-agreement-checkbox-has-been-checked/129276/4 "2008-02-17T00:19:39Z")

</div>

It’s an IRC server, get an IRC client like mirc [http://mirc.com](http://mirc.com) and then  
type /server [irc.freenode.net](http://irc.freenode.net) -j #rubyonrails into the bar at the bottom  
after entering all your details.

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [February 16, 2008, 9:17pm UTC](https://www.ruby-forum.com/t/validating-that-a-user-agreement-checkbox-has-been-checked/129276/5 "2008-02-16T21:17:08Z")

</div>

Rick, Thanks. That was it.

Ryan, Yeah, I’ve probably overstayed my welcome somewhat. This is  
such a great group but I should branch out. Is “[irc.freenode.net](http://irc.freenode.net)  
#rubyonrails” a newsgroup? I tried visiting the URL and  
“[irc.freenode.net](http://irc.freenode.net)” but got a server not found error. Incidentally I  
visit this through Google G…

- Dave

On Feb 15, 8:35 pm, “Ryan B. (Radar)” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)
