diff --git a/lib/rails3-jquery-autocomplete.rb b/lib/rails3-jquery-autocomplete.rb index ac700194..12d5f811 100644 --- a/lib/rails3-jquery-autocomplete.rb +++ b/lib/rails3-jquery-autocomplete.rb @@ -19,8 +19,20 @@ class ActionController::Base # TODO: Better way to load plugins begin require 'formtastic' - class Formtastic::FormBuilder < ActionView::Helpers::FormBuilder - include Rails3JQueryAutocomplete::FormtasticPlugin + module Formtastic + module Inputs + class AutocompleteInput + include Base + include Base::Stringish + + def to_html + input_wrapping do + label_html << + builder.autocomplete_field(method, options.delete(:url), input_html_options) + end + end + end + end end rescue LoadError end