diff --git a/lib/rails3-jquery-autocomplete/autocomplete.rb b/lib/rails3-jquery-autocomplete/autocomplete.rb index fefc9146..32be3e5d 100644 --- a/lib/rails3-jquery-autocomplete/autocomplete.rb +++ b/lib/rails3-jquery-autocomplete/autocomplete.rb @@ -42,7 +42,7 @@ def self.included(target) # module ClassMethods def autocomplete(object, method, options = {}) - define_method("autocomplete_#{object}_#{method}") do + define_method("autocomplete_#{object}_#{method.first}") do method = options[:column_name] if options.has_key?(:column_name) @@ -57,7 +57,7 @@ def autocomplete(object, method, options = {}) items = {} end - render :json => json_for_autocomplete(items, options[:display_value] ||= method, options[:extra_data]) + render :json => json_for_autocomplete(items, options[:display_value] ||= method.first, options[:extra_data]) end end end