Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
An input plugin for formtastic to render autocomplete fields automagically
Ruby
Branch: master
Pull request Compare This branch is 13 commits ahead of elandesign:master.

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
lib
spec
.gitignore
LICENSE
README.textile
Rakefile
init.rb

README.textile

Formtastic jRails autocomplete

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).

Usage example

<% semantic_form_for @user do |form| %>
  <% form.inputs do %>
    <%= form.input :name, :as => :autocomplete, :min_length => 3 %>
  <% end %>
<% end %>

Classic AJAX version (using other autocomplete plugin)

<% semantic_form_for @user do |form| %>
  <% form.inputs do %>
    <%= form.input :name, :as => :autocomplete, :url => autocomplete_task_name_path() %>
  <% end %>
<% end %>

Dependencies

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.

Credits

Thanks to Paul Smith for the original idea

Found a Bug?

Please direct all queries to the issue tracker:

http://github.com/michelefranzin/formtastic_jrails_autocomplete/issues

References

1 Formtastic @ GitHub

2 JRails AutoComplete @ GitHub

Copyright

Copyright © 2010 Michele Franzin. See LICENSE for details.

Something went wrong with that request. Please try again.