# How to retain values

**URL:** <https://www.ruby-forum.com/t/how-to-retain-values/158459>\
**Category:** Rails\
**Created:** [January 23, 2009, 3:31pm UTC](https://www.ruby-forum.com/t/how-to-retain-values/158459 "2009-01-23T15:31:47Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![anil123](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/3da27b/32.png) [@anil123](https://www.ruby-forum.com/u/anil123)\
**Post date:** [January 23, 2009, 3:31pm UTC](https://www.ruby-forum.com/t/how-to-retain-values/158459/1 "2009-01-23T15:31:47Z")

</div>

Hi all,  
am new to Ruby world.

My problem is,  
I have 4 text fields,i wrote the validations for that like if blank?  
etc…  
I filled 3 fields then clicked the submit button, it displayed fine the  
error that “please enter the required field” but the entered 3 values  
are not displayed.  
Can any one please assist me ASAP.

Thanks,  
Nany.

---

<div class="post-metadata">

**Author:** ![anil123](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/3da27b/32.png) [@anil123](https://www.ruby-forum.com/u/anil123)\
**Post date:** [January 23, 2009, 3:36pm UTC](https://www.ruby-forum.com/t/how-to-retain-values/158459/2 "2009-01-23T15:36:43Z")

</div>

Hi Anil,

Can you post some code snippets of your controller (new and create  
action)? seems like the form is not being setup correctly (probably  
in the create action of the controller)

Thanks,  
Rob

---

<div class="post-metadata">

**Author:** ![anil123](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/3da27b/32.png) [@anil123](https://www.ruby-forum.com/u/anil123)\
**Post date:** [January 23, 2009, 6:59pm UTC](https://www.ruby-forum.com/t/how-to-retain-values/158459/3 "2009-01-23T18:59:35Z")

</div>

A fairly common thing I’ve seen is that, upon failure, the code in the  
create method will perform a redirect to the new method, rather than  
just a render of the action new
