# Validate a form NOT connected to a model

**URL:** <https://www.ruby-forum.com/t/validate-a-form-not-connected-to-a-model/61685>\
**Category:** Rails\
**Created:** [May 26, 2006, 2:54am UTC](https://www.ruby-forum.com/t/validate-a-form-not-connected-to-a-model/61685 "2006-05-26T02:54:44Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ben\_Wyrosdick](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/f05b48/32.png) [@Ben\_Wyrosdick](https://www.ruby-forum.com/u/Ben_Wyrosdick)\
**Post date:** [May 26, 2006, 2:54am UTC](https://www.ruby-forum.com/t/validate-a-form-not-connected-to-a-model/61685/1 "2006-05-26T02:54:44Z")

</div>

Is there any way to validate a form that isn’t connected to a model. I  
have  
a form that connects to a controller action and I want to validate the  
inputs on the form like I would with the validates\_ATTRIBUTE\_of property  
on  
a model. Is there any way to do this?

---

<div class="post-metadata">

**Author:** ![Ben\_Wyrosdick](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/f05b48/32.png) [@Ben\_Wyrosdick](https://www.ruby-forum.com/u/Ben_Wyrosdick)\
**Post date:** [October 22, 2006, 10:48pm UTC](https://www.ruby-forum.com/t/validate-a-form-not-connected-to-a-model/61685/2 "2006-10-22T22:48:03Z")

</div>

Ben Wyrosdick wrote:

> Is there any way to validate a form that isn’t connected to a model. I  
> have  
> a form that connects to a controller action and I want to validate the  
> inputs on the form like I would with the validates\_ATTRIBUTE\_of property  
> on  
> a model. Is there any way to do this?

Did you ever get this figured out? I have the same issue.

Thanks in Advance  
Thom

---

<div class="post-metadata">

**Author:** ![Ben\_Wyrosdick](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/f05b48/32.png) [@Ben\_Wyrosdick](https://www.ruby-forum.com/u/Ben_Wyrosdick)\
**Post date:** [October 23, 2006, 12:59am UTC](https://www.ruby-forum.com/t/validate-a-form-not-connected-to-a-model/61685/3 "2006-10-23T00:59:39Z")

</div>

You could try using activespec to make some spec objects for your  
forms, and use this to validate the data.

[http://activespec.rubyforge.org](http://activespec.rubyforge.org)

---

<div class="post-metadata">

**Author:** ![Ben\_Wyrosdick](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/f05b48/32.png) [@Ben\_Wyrosdick](https://www.ruby-forum.com/u/Ben_Wyrosdick)\
**Post date:** [October 23, 2006, 1:15am UTC](https://www.ruby-forum.com/t/validate-a-form-not-connected-to-a-model/61685/4 "2006-10-23T01:15:41Z")

</div>

[http://www.bphogan.com/learn/pdf/tableless\_contact\_form.pdf](http://www.bphogan.com/learn/pdf/tableless_contact_form.pdf) provides a  
description which will help, I think
