[Rails] [ANN] Caching Auto Complete Field

Bob Silva
Fri, 17 Feb 2006 02:21:17 -0000

Greetings,



I''ve extended script.aculo.us to have the autocompleter cache it
results in
the browser and only callback to the server when you clear your filter.

This provides good performance for lists with lots of elements on a busy
site. Typically, your initial result set doesn''t actually change, items
just
get filtered out.

Why have your database perform this simple filtering when the client can
easily do it for you.



Right now, it acts like a sql ''filter%'' but can easily be
modified to act
like a ''%filter%''.



It''s also a good example of how you can extend
script.aculou.us/prototype
with new functionality without modifying the source files, similar in
concept to Rails plugins.



Hope someone finds it useful.



You can download it and see it in action here:



http://www.railtie.net/articles/2006/02/16/extending-script-aculo-us





Bob Silva

http://www.railtie.net/

Beginner Tutorials and Plug-ins for Rails

-------------- next part --------------
An HTML attachment was scrubbed...