<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>lib/auto_complete_form_helper.rb</filename>
    </added>
    <added>
      <filename>test/auto_complete_form_helper_test.rb</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -1,23 +1,23 @@
-Example:
+Fork of the standard auto_complete plugin to create auto complete text fields that
+can be repeated more than once a single form.
 
-  # Controller
-  class BlogController &lt; ApplicationController
-    auto_complete_for :post, :title
-  end
+A &quot;text_field_with_auto_complete&quot; method is made available to form_for and fields_for that:
+- Insures unique id's for &lt;input&gt; and &lt;div&gt; tags
+- Uses the object name from the surrounding call to form_for or fields_for so attribute
+mass assignment will work as usual
+- Works with the same server side controller method, auto_complete_for, as usual
 
-  # View
-  &lt;%= text_field_with_auto_complete :post, title %&gt;
+See: http://patshaughnessy.net/repeated_auto_complete for details.
 
-By default, auto_complete_for limits the results to 10 entries,
-and sorts by the given field.
+Example
+=======
 
-auto_complete_for takes a third parameter, an options hash to
-the find method used to search for the records:
+&lt;% for person in @group.people %&gt;
+  &lt;% auto_complete_fields_for &quot;group[person_attributes][]&quot;, person do |person_form| %&gt;
+    &lt;p&gt;
+      Person &lt;%= person_form.label :name %&gt;&lt;br/&gt;
+      &lt;%= person_form.text_field_with_auto_complete :person, :name, {}, {:method =&gt; :get }  %&gt; 
+  &lt;% end %&gt;
+&lt;% end %&gt;
 
-  auto_complete_for :post, :title, :limit =&gt; 15, :order =&gt; 'created_at DESC'
-
-For more examples, see script.aculo.us:
-* http://script.aculo.us/demos/ajax/autocompleter
-* http://script.aculo.us/demos/ajax/autocompleter_customized
-
-Copyright (c) 2007 David Heinemeier Hansson, released under the MIT license   
+Copyright (c) 2009 [Pat Shaughnessy], released under the MIT license</diff>
      <filename>README</filename>
    </modified>
    <modified>
      <diff>@@ -1,2 +1,3 @@
 ActionController::Base.send :include, AutoComplete
-ActionController::Base.helper AutoCompleteMacrosHelper
\ No newline at end of file
+ActionController::Base.helper AutoCompleteMacrosHelper
+ActionView::Base.send :include, AutoCompleteFormHelper</diff>
      <filename>init.rb</filename>
    </modified>
    <modified>
      <diff>@@ -105,8 +105,14 @@ module AutoCompleteMacrosHelper
   # auto_complete_for to respond the AJAX calls,
   # 
   def text_field_with_auto_complete(object, method, tag_options = {}, completion_options = {})
+    auto_complete_field_with_style_and_script(object, method, tag_options, completion_options) do
+      text_field(object, method, tag_options)
+    end
+  end
+
+  def auto_complete_field_with_style_and_script(object, method, tag_options = {}, completion_options = {})
     (completion_options[:skip_style] ? &quot;&quot; : auto_complete_stylesheet) +
-    text_field(object, method, tag_options) +
+    yield +
     content_tag(&quot;div&quot;, &quot;&quot;, :id =&gt; &quot;#{object}_#{method}_auto_complete&quot;, :class =&gt; &quot;auto_complete&quot;) +
     auto_complete_field(&quot;#{object}_#{method}&quot;, { :url =&gt; { :action =&gt; &quot;auto_complete_for_#{object}_#{method}&quot; } }.update(completion_options))
   end</diff>
      <filename>lib/auto_complete_macros_helper.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>7b18f05af68dec0f9e45b1a01d6b7c94e306caeb</id>
    </parent>
  </parents>
  <author>
    <name>Pat Shaughnessy</name>
    <email>pat@patshaughnessy.net</email>
  </author>
  <url>http://github.com/patshaughnessy/auto_complete/commit/0814a25a754a235c5cf6f7a258fa405059a5ca6f</url>
  <id>0814a25a754a235c5cf6f7a258fa405059a5ca6f</id>
  <committed-date>2009-01-27T12:49:48-08:00</committed-date>
  <authored-date>2009-01-27T12:49:48-08:00</authored-date>
  <message>Refactored to allow repeated fields on a complex form</message>
  <tree>f2f7325741ee587d983e56ebd62cdd5c61b1c1f3</tree>
  <committer>
    <name>Pat Shaughnessy</name>
    <email>pat@patshaughnessy.net</email>
  </committer>
</commit>
