    # File lib/action_view/helpers/java_script_macros_helper.rb, line 133
          def auto_complete_field(field_id, options = {})
            function =  "var #{field_id}_auto_completer = new Ajax.Autocompleter("
            function << "'#{field_id}', "
            function << "'" + (options[:update] || "#{field_id}_auto_complete") + "', "
            function << "'#{url_for(options[:url])}'"

            js_options = {}
            js_options[:tokens] = array_or_string_for_javascript(options[:tokens]) if options[:tokens]
            js_options[:callback]   = "function(element, value) { return #{options[:with]} }" if options[:with]
            js_options[:indicator]  = "'#{options[:indicator]}'" if options[:indicator]
            js_options[:select]     = "'#{options[:select]}'" if options[:select]
            js_options[:frequency]  = "#{options[:frequency]}" if options[:frequency]

            { :after_update_element => :afterUpdateElement,
              :on_show => :onShow, :on_hide => :onHide, :min_chars => :minChars }.each do |k,v|
              js_options[v] = options[k] if options[k]
            end

            function << (', ' + options_for_javascript(js_options) + ')')

            javascript_tag(function)
          end