Skip to content

fuzziness/formtastic_jrails_autocomplete

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

An input plugin for formtastic to render autocomplete fields automagically

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Ruby 100.0%