# Text\_field value doubt

**URL:** <https://www.ruby-forum.com/t/text-field-value-doubt/191318>\
**Category:** Rails\
**Created:** [July 9, 2010, 3:10pm UTC](https://www.ruby-forum.com/t/text-field-value-doubt/191318 "2010-07-09T15:10:43Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![nazimzeeshan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/77aa72/32.png) [@nazimzeeshan](https://www.ruby-forum.com/u/nazimzeeshan)\
**Post date:** [July 9, 2010, 3:10pm UTC](https://www.ruby-forum.com/t/text-field-value-doubt/191318/1 "2010-07-09T15:10:43Z")

</div>

\<%= f.text\_field :item, :value =\> Date.today %\>  
above code displays todays date in item text field.

I want to display the parameter thr(search string)…somthin lik  
\<%= f.text\_field :item, :value =\> params[:search\_string] %\>  
but above code does not work.

Textfield is blank and no param value is printed. why? plz help.

Btw the search\_string(param) was entered thru a textField that was in a  
different view page. do we have to pass it to this ‘creteForm’ view  
page. if yes,how to do it?

---

<div class="post-metadata">

**Author:** ![nazimzeeshan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/77aa72/32.png) [@nazimzeeshan](https://www.ruby-forum.com/u/nazimzeeshan)\
**Post date:** [July 9, 2010, 3:41pm UTC](https://www.ruby-forum.com/t/text-field-value-doubt/191318/2 "2010-07-09T15:41:41Z")

</div>

On 9 July 2010 14:10, Zeeshan N. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> different view page. do we have to pass it to this ‘creteForm’ view  
> page. if yes,how to do it?

Have a look at the Getting Started guide at  
[http://guides.rubyonrails.org/](http://guides.rubyonrails.org/). It will show you how to setup an @  
variable in the controller to display in the view.

Also have a look at the guide on debugging so that you see how to  
break into your code and inspect variables to see what is going on  
when it does not work.

Colin
