auto_complete_field

- 1.0.0 (0)
- 1.1.6 (11)
- 1.2.6 (5)
- 2.0.3
- 2.1.0
- 2.2.1
- 2.3.8
- 3.0.0
- 3.0.9
- 3.1.0
- 3.2.1
- 3.2.8
- 3.2.13
- 4.0.2
- 4.1.8
- 4.2.1
- 4.2.7
- 4.2.9
- 5.0.0.1
- 5.1.7
- 5.2.3
- 6.0.0
- 6.1.3.1
- 6.1.7.7
- 7.0.0
- 7.1.3.2
- 7.1.3.4
- What's this?
auto_complete_field(field_id, options = {})
public
Adds AJAX autocomplete functionality to the text input field with the DOM ID specified by field_id.
This function expects that the called action returns a HTML <ul> list, or nothing if no entries should be displayed for autocompletion.
You’ll probably want to turn the browser’s built-in autocompletion off, su be sure to include a autocomplete="off" attribute with your text input field.
Required options are:
:url: | URL to call for autocompletion results in url_for format. |
Addtional options are:
:update: | Specifies the DOM ID of the element whose innerHTML should be updated with the autocomplete entries returned by the AJAX request. Defaults to field_id + ‘_auto_complete’ |
:with: | A JavaScript expression specifying the parameters for the XMLHttpRequest. This defaults to ‘fieldname=value’. |
:indicator: | Specifies the DOM ID of an element which will be displayed while autocomplete is running. |
:tokens: | A string or an array of strings containing separator tokens for tokenized incremental autocompletion. Example: :tokens => ',' would allow multiple autocompletion entries, separated by commas. |
:min_chars: | The minimum number of characters that should be in the input field before an Ajax call is made to the server. |
:on_hide: | A Javascript expression that is called when the autocompletion div is hidden. The expression should take two variables: element and update. Element is a DOM element for the field, update is a DOM element for the div from which the innerHTML is replaced. |
:on_show: | Like on_hide, only now the expression is called then the div is shown. |

Moved to plugin "auto_complete"
This helper was moved to plugin “auto_complete” - http://svn.rubyonrails.org/rails/plugins/auto_complete/

Installation
Install the plugin by typing
script/plugin install auto_complete
Remember to restart webservice :)