Autocomplete in array

Experts,

have you figure it out with autocomplete to pass as array objects?

still i’m finding out the way to figure. :frowning:

regards,

Bala

El Jul 11, 2007, a las 8:08 AM, Bala
escribió:

have you figure it out with autocomplete to pass as array objects?

still i’m finding out the way to figure. :frowning:

Can you be more specific please? Perhaps with an example?

– fxn

Fxn,

here is the situation,

my requirement is to send a mail to multiple contacts with different
autocomplete field, there i must need to place an array

but the actual code of view is for single data wil be <%=
text_field_with_auto_complete :contact, :name %> as single name

but i want as array

regards,

Bala

El Jul 11, 2007, a las 4:31 PM, Bala
escribió:

my requirement is to send a mail to multiple contacts with different
autocomplete field, there i must need to place an array

but the actual code of view is for single data wil be <%=
text_field_with_auto_complete :contact, :name %> as single name

So you autocomplete a single string, and that string represents a set
of contacts somehow? If that’s correct are they kind of groups? Can
you send something that identifies the group back to the server
instead of an array of addresses?

– fxn

here is the example of HTML

Contact One -
Contact Two -
Contact Three -

so here “contact_name[]” returns as array.

Same like this i want using autocomplete.

Just help this out Fxn, i’ve been try this for past a week. its being
an loads to my head

El Jul 12, 2007, a las 6:20 AM, Bala
escribió:

Contact One -
Contact Two -
Contact Three -

so here “contact_name[]” returns as array.

I see. There are two approaches.

One is to have a single text field that uses some token between
names, for instance a commna. You configure that with the :tokens
option.

The other one is to have a single text field per contact as in the
example above. You can’t have more than one text field with
autocompletion in the same page due to conflicting HTML IDs, but
there’s a workaround here:

Wolfmans Howlings
text_field_with_auto_complete-in-the-same-view

– fxn

El Jul 13, 2007, a las 9:07 AM, Bala
escribió:

Still couldnt get it i tried the example which you gave

Which example?

It would be useful to be more clear about what your code is actually
doing. Please, write a single view with minimal HTML and a minimal
controller/action to mimic what you want to accomplish. That is,
reproduce the problem in isolated conditions until you get it right.
If you can’t get that minimal example to work, please send it and we
we’ll review it.

Just in case, before you try to solve the case for arrays be sure you
understand how simple autocompletion works in Rails.

– fxn

I have to concur, just saying “it doesn’t work” is not very helpful.

The example in the blog works if implemented correctly, I use it all
the time.

You need to post more information about what the problem is before
anyone can help you.

Still couldnt get it i tried the example which you gave

Bala

Hi,

a helpful blog entry, thanks for the pointer.

BTW your link was truncated - should be:

http://blog.wolfman.com/articles/2006/10/17/having-multiple-text_field_with_auto_complete-in-the-same-view

tonypm