I have a crude hack to allow auto_complete to work with indexed text
fields. I needed it for a timecard entry form with an arbtirary
number of records which can be added/changed/delete willy-nilly by
users. One of the fields is a perfect candidate for autocomplete
since it references a database object with a large number of choices
and long descriptions. Using a select list is extremely ugly in this
I copied the code for text_field_with_auto_complete out of
and hacked it, putting the result in
as text_field_with_index_auto_complete. All it does differently is
not output the index in the name of the method to be called.
I copied the code for auto_complete_for out of
and pasted it right back in as auto_complete_with_index_for. It just
ignores the index in the parameter. Everything else is the same.
I will probably submit a bug report and a patch eventually, but in the
meantime, I would like to know if I can put the new
auto_complete_with_index_for somewhere local to my application, or
does it have to live in the rails source?