Easy: text_field_tag

<%= 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!

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]

Great!! Thanks Fred