Wednesday, October 28, 2009

String value not displayed in input text field in a form

If you have the following,

<% form_tag '/index' do %>
<% text_field_tag 'date', '2009-01-01' %>
<% submit_tag 'Go' %>
<% end %>

You would think the textfield above would have "2009-01-01" string displayed. But it is not so. Need to specify "GET" method.

<% form_tag '/index', :method => :get do %>
...

No comments:

Blog Archive