Using ajax-enabled search field in rails


#1

Hi.

I followed the ajax-the-rails-way in the (quite usefull) Agile web
dev. with rails. I have a search-field where I can enter a postalcode
(zipcode).

<%= observe_field(:search,
:frequency => 0.9,
:update => :results,
:url => { :action => :search }) %>

Is it possible to have both the :frequency and another conditions
which starts searching when two or more digits have been entered into
the search-field? The db is postgresql and I use the wildcard 'select

  • from postalcodes where postalcode like xyz%’ where xyz is the value
    entered in search.

regards
Claus