Topic: how could i make a facebook style autocomplete form?

Something Like This

Something Like This

Last edited by jtomasrl (2011-01-03 00:55:18)

Re: how could i make a facebook style autocomplete form?

Start by reading up on observers!

The Rails part of the problem is pretty straight forward.

Rails can set things up so that an oberver will monitor an input, and fire off some AJAX every X milliseconds (500 is typical).   Everything else will be a matter of writing the action that handles that AJAX call,  likely returning the required HTML list to be displaed in your view, i.e. via

:update=>'myfancypulldown'

Joe got a job, on the day shift, at the Utility Muffin Research Kitchen, arrogantly twisting the sterile canvas snout of a fully charged icing anointment utensil.

Re: how could i make a facebook style autocomplete form?

rails 2.x.x has prototype helpers to observe client side actions. In rails 3 these got the kabosh (because obtrusive JS is not good).

Look into jQuery .change() method  - that's most likely what you want to use to observe form fields. However, it looks like you want search/autocomplete functionality. In that case, you may also want to look into jQuery autocomplete

- Ben