From a9c4a5b20f79794aea35eb24449bc8975fdd586b Mon Sep 17 00:00:00 2001 From: Christoph Thiel Date: Mon, 8 Aug 2011 13:13:45 +0200 Subject: [PATCH] Formtastic 2.0 compatibilty fix Conflicts: lib/rails3-jquery-autocomplete.rb --- lib/rails3-jquery-autocomplete.rb | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) 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