views:

277

answers:

3

Are there any gems that would help me make a search box like the one for tags on stackoverflow?

(Rails 2.3.5, required IE7 support and graceful no-script fall-back)

P.S.: Do these boxes annoy you or do you think it's a good thing to have one?

A: 

jQuery AutoComplete

The one for Google annoys me, but only because it moves the Google Search button, so when I click, I sometimes accidentally click one of the items in the AutoComplete list instead of the Search button. Very aggravating.

Robert Harvey
This annoys me when I watch other people. Just hit Enter.
blinry
@blinry: You have a point, but it's still a GUI problem. Structurally, a button is supposed to be a fixed part of the form surface; what other application do you know of that moves buttons around while the user is trying to enter data?
Robert Harvey
A: 

Indeed there is, its called auto_complete http://github.com/rails/auto_complete It used to be part of rails, but was extracted out into a plugin, checkout this screencast for more information http://railscasts.com/episodes/102-auto-complete-association

Jon
A: 

jQuery UFD is a good one for cases where you have a small number of options to search through, particularly if you want to be able to add new ones. It attaches to a select tag.

Frank Schmitt