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 (#75 Complex Forms Part 3 - RailsCasts):

<%= 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

Each partial duplicates this:

  • task:


  • Thanks,