Problem in rendering :partial with auto_complete_field

I wrote some codes to generate a input field with auto complete
functionality, these codes work well in a regular form, the codes are:

=========================================================

<%= auto_complete_field( “vc_container_no”,
:frequency => 0.01,
:min_chars => 2,
:url=>{:action=>‘autocomplete_vc_cno’,
:cno=>‘OO’},
:tokens => ‘,’) %>

However, when I use the same codes inside a :partial and render them
with a
collection, the input field still there, but the auto complete function
no longer exist. At first I was suspecting that the problem come from
the duplicate IDs of the and the

after rendering the
collection, so I add a unique no. after the IDs, but it stills doesn’t
work.

I have worked on this problem the whole week but can not find solution,
anyone have some idea about that? or has a sucessful experience of
rendering :partial with auto_complete_field inside?

Thanks in advance.

Ieong

Mc Ieong wrote:

I wrote some codes to generate a input field with auto complete
functionality, these codes work well in a regular form, the codes are:

What about showing us the not working code? In particular the partial
and the

render :partial => ???, collection => …

Regards, T.

Mc Ieong wrote:

Anyone has success experience on rendering partial with auto_complete
insided ??

Mc Ieong wrote:

Anyone has success experience on rendering partial with auto_complete
insided ??

T. N. T. wrote:

Mc Ieong wrote:

I wrote some codes to generate a input field with auto complete
functionality, these codes work well in a regular form, the codes are:

What about showing us the not working code? In particular the partial
and the

render :partial => ???, collection => …

Regards, T.

index.html.erb:

<%= render(:partial => "voyage_container", :collection => @voyage_containers) %>

_voyage_container:

<% @vc = voyage_container %>

... ...

the auto_complete_field generate:

<script type="text/javascript">

//

Sorry, the codes are ugly, as I am very new to Ror…

<%= auto_complete_field( "vc_container_no", :frequency => 0.01, :min_chars => 2, :url=>{:action=>'autocomplete_vc_cno', :cno=>'OO'}, :tokens => ',') %>

Mc Ieong wrote:

Mc Ieong wrote:

Anyone has success experience on rendering partial with auto_complete
insided ??

Are you using Ruby 1.9.1?
I have the same problem when using 1.9.1 but not with 1.8.6 which works
as it is supposed to.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs