How can I set default value for text_field?

Zhao Yi wrote:

Please this code:

<p>     <%= f.label :"Host Name" %><br />     <%= f.text_field :HostName %> </p>

I want to set a default to this text field, how can I do this?

Is this what you looking for? <%= f.text_field :HostName, :value => "my default value" %>

Petan Cert wrote:

Zhao Yi wrote:

Please this code:

<p>     <%= f.label :"Host Name" %><br />     <%= f.text_field :HostName %> </p>

I want to set a default to this text field, how can I do this?

Is this what you looking for? <%= f.text_field :HostName, :value => "my default value" %>

Yes, this is exactly what I am looking for.

thanks.