Topic: Observe_field?

Observe Field
<label for="search">Search term:</label>
<%= text_field_tag :search %>
<%= observe_field(:search,
                  :frequency => 0.5,
                  :update => :results,
                  :url => { :action => :search }) %>
<div id="results"></div>

Please explain this Observe_field tag

Online

Re: Observe_field?

Observe_field looks at a text_field every so often and will update the results without you having to press a submit button. This observe_field looks like it is for a searchbox, the text_field labeled "search" is checked every .5 seconds, the part of the page that will be updated is the section labeled "results," and the action in the controller that will be called is "search."