# Form Validation without a Model (Showing the users input whe

**URL:** <https://www.ruby-forum.com/t/form-validation-without-a-model-showing-the-users-input-whe/88916>\
**Category:** Rails\
**Created:** [March 15, 2007, 4:14pm UTC](https://www.ruby-forum.com/t/form-validation-without-a-model-showing-the-users-input-whe/88916 "2007-03-15T16:14:41Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![danhobbs](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/a5b964/32.png) [@danhobbs](https://www.ruby-forum.com/u/danhobbs)\
**Post date:** [March 15, 2007, 4:14pm UTC](https://www.ruby-forum.com/t/form-validation-without-a-model-showing-the-users-input-whe/88916/1 "2007-03-15T16:14:41Z")

</div>

Hi all,

I’m writing a Advanced Search form which is not attached to a model  
and I’m wondering if there’s an easy way to re-show the the form to  
the user with their inputted values shown back to them if validation  
fails.

Example:

1. user fills in the search text field with “Dan”
2. user hits submit
3. the user forgot to select a value from a drop down box (eg  
search on first name)
4. renders the form with the error message added to flash
5. form is blank!

Of course this works (the users’ inputted values are re-shown) for  
form helpers that are based on a model, but what if it’s a form like  
a search form?

Cheers,  
Dan

---

<div class="post-metadata">

**Author:** ![danhobbs](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/a5b964/32.png) [@danhobbs](https://www.ruby-forum.com/u/danhobbs)\
**Post date:** [March 15, 2007, 4:23pm UTC](https://www.ruby-forum.com/t/form-validation-without-a-model-showing-the-users-input-whe/88916/2 "2007-03-15T16:23:41Z")

</div>

This looks like a pretty good solution:

[http://agilewebdevelopment.com/plugins/activerecord\_base\_without\_table](http://agilewebdevelopment.com/plugins/activerecord_base_without_table)

Cheers,  
Tyler

Dan H. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> 1. user hits submit  
> Dan
> 
> >

–
