An extension for Formtastic1 to automagically support fields with auto completion, using jrails_auto_complete gem2 (unobtrusive javascript).
Should work also with other autocomplete plugins (FormBuilder must respond to text_field_with_auto_complete method).
<% semantic_form_for @user do |form| %>
<% form.inputs do %>
<%= form.input :name, :as => :autocomplete, :min_length => 3 %>
<% end %>
<% end %>
<% semantic_form_for @user do |form| %>
<% form.inputs do %>
<%= form.input :name, :as => :autocomplete, :url => autocomplete_task_name_path() %>
<% end %>
<% end %>
You must have the formtastic gem added to your application + an autocomplete gem/plugin present and the :defaults javascript must be included in your layout.
Thanks to Paul Smith for the original idea
Please direct all queries to the issue tracker:
http://github.com/michelefranzin/formtastic_jrails_autocomplete/issues
2 JRails AutoComplete @ GitHub
Copyright © 2010 Michele Franzin. See LICENSE for details.