T
T_P
Hi!
I have this in my controller:
@text = params[:data][:text]
In the view, I have this code:
<%= label_tag('data[text]', "Word/phrase: ") %> <br />
<%= text_field_tag( 'data[text]', @text, :size => 40, :maxlength =>
254 ) %>
What I would like to have is to get a default value for the form
field. I cannot figure out why @text controller instance variable
doesn't work. It's a non-empty string, but the corresponding form
field is always blank. :-(
However, this piece of code always works,
<%= text_field_tag( 'data[text]', 'STATIC STRING', :size =>
40, :maxlength => 254 ) %>
What am I missing here? :-/
Tuo
I have this in my controller:
@text = params[:data][:text]
In the view, I have this code:
<%= label_tag('data[text]', "Word/phrase: ") %> <br />
<%= text_field_tag( 'data[text]', @text, :size => 40, :maxlength =>
254 ) %>
What I would like to have is to get a default value for the form
field. I cannot figure out why @text controller instance variable
doesn't work. It's a non-empty string, but the corresponding form
field is always blank. :-(
However, this piece of code always works,
<%= text_field_tag( 'data[text]', 'STATIC STRING', :size =>
40, :maxlength => 254 ) %>
What am I missing here? :-/
Tuo