From: T_P Date: 2009-12-21T20:35:17+09:00 Subject: Value for text_field_tag ? Hi! I have this in my controller: @text = params[:data][:text] In the view, I have this code: <%= label_tag('data[text]', "Word/phrase: ") %>
<%= 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