# Easy: text\_field\_tag

**URL:** <https://www.ruby-forum.com/t/easy-text-field-tag/145066>\
**Category:** Rails\
**Created:** [August 5, 2008, 6:25pm UTC](https://www.ruby-forum.com/t/easy-text-field-tag/145066 "2008-08-05T18:25:41Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jturney](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e99b99/32.png) [@jturney](https://www.ruby-forum.com/u/jturney)\
**Post date:** [August 5, 2008, 6:25pm UTC](https://www.ruby-forum.com/t/easy-text-field-tag/145066/1 "2008-08-05T18:25:41Z")

</div>

\<%= text\_field\_tag :search, params[:search], :id=\>“search\_field”,  
:value=\>params[:search] %\>

I found this, and I’m just wondering what the first parameter, :search,  
is exactly. And does the second parameter mean params[:search] =  
text\_field\_tag’s value?

Thanks!

---

<div class="post-metadata">

**Author:** ![jturney](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e99b99/32.png) [@jturney](https://www.ruby-forum.com/u/jturney)\
**Post date:** [August 5, 2008, 6:39pm UTC](https://www.ruby-forum.com/t/easy-text-field-tag/145066/2 "2008-08-05T18:39:09Z")

</div>

On 5 Aug 2008, at 17:25, Justin To wrote:

> \<%= text\_field\_tag :search, params[:search], :id=\>“search\_field”,  
> :value=\>params[:search] %\>
> 
> I found this, and I’m just wondering what the first parameter, :search

The first parameter is the name of the input element

> is exactly. And does the second parameter mean params[:search] =  
> text\_field\_tag’s value?

The second parameter means the text field’s initial contents will be  
params[:search]

---

<div class="post-metadata">

**Author:** ![jturney](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e99b99/32.png) [@jturney](https://www.ruby-forum.com/u/jturney)\
**Post date:** [August 5, 2008, 6:45pm UTC](https://www.ruby-forum.com/t/easy-text-field-tag/145066/3 "2008-08-05T18:45:33Z")

</div>

Great!! Thanks Fred
