Using text_field_with_auto_complete in partials?

Anyone know how to use text_field_with_auto_complete in place of
f.text_field in the partial?

Using Ryan B.’ example (http://railscasts.com/episodes/75):

<%= text_field_with_auto_complete :task_attributes, :name, :object =>
task %>

Here’s my problem…

Because it’s a partial, the id and name attributes are duplicated for
each partial instance, so the autocomplete only works on the first
instance of the partial, not to mention it’s invalid XHTML to have dupe
id’s.

Each partial duplicates this:

  • task:

     remove

  • Thanks,
    Mark