<% form_tag documents_path, :method => 'get' do %>
<div id="search">
<%= link_to("Show All") if params[:q] %>
<%= text_field_tag :q, params[:q] %>
<%= submit_tag "Search", :name => nil, :id => 'search_submit' %>
</div>
<% end %>
Walter
> --
> You received this message because you are subscribed to the Google
> Groups "Ruby on Rails: Talk" group.
> To post to this group, send email to rubyonrails-
> ta...@googlegroups.com.
> To unsubscribe from this group, send email to rubyonrails-ta...@googlegroups.com
> .
> For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en
> .
>
http://www.folksonomy.org/2008/12/22/rails-auto-clearing-input-field/
Note that any element like this will rely on JavaScript on the client
to keep from submitting the default value. Be sure to check in your
controller for that explicit value and ignore the search event in that
case.
Walter