# Bizarre auto\_complete problem

**URL:** <https://www.ruby-forum.com/t/bizarre-auto-complete-problem/143663>\
**Category:** Rails\
**Created:** [July 21, 2008, 5:30pm UTC](https://www.ruby-forum.com/t/bizarre-auto-complete-problem/143663 "2008-07-21T17:30:44Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dino\_d](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/b5ac83/32.png) [@dino\_d](https://www.ruby-forum.com/u/dino_d)\
**Post date:** [July 21, 2008, 5:30pm UTC](https://www.ruby-forum.com/t/bizarre-auto-complete-problem/143663/1 "2008-07-21T17:30:44Z")

</div>

Hi -

I’m having a really weird problem with text\_field\_with\_auto\_complete.  
I use this for looking up tags. When I type in the beginning of a  
tag, the drop down appears, and sometimes the contents of the

- is  
truncated. I rewrote a debug version of auto\_complete\_result to test  
this out:

def auto\_complete\_result(entries, field, phrase = nil)  
return unless entries  
answer ="

"  
for entry in entries  
answer+="- #{entry[field]} - debug
"  
end  
answer +="
"  
end

This only seems to happen when I have one and only one matching entry  
in the lookup table. So, if i type in “eco” for example, and the only  
matching tag in the table is ‘economy,’ then I expect this:

    - economy - debug

But, what I get instead is

    - economy - deb

The inner contents are truncated. It’s so weird. I’ve confirmed that  
the actual html has the truncated entry.

Here’s where it gets weirder. It only happens on Firefox. On ie, it  
does not truncate. Again, it only happens on my host, not when i run  
a local server. I’ve tried removing the stylesheets and use the  
default styling, same problem.

The only difference as far as I can tell from my dev machine and host  
machine is running ruby 1.8.5, and my local machine is running 1.8.6.

Has anyone seen this weird behavior before or have any suggestions on  
how to approach it?

Thanks,  
Dino

---

<div class="post-metadata">

**Author:** ![dino\_d](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/b5ac83/32.png) [@dino\_d](https://www.ruby-forum.com/u/dino_d)\
**Post date:** [July 23, 2008, 3:53am UTC](https://www.ruby-forum.com/t/bizarre-auto-complete-problem/143663/2 "2008-07-23T03:53:43Z")

</div>

For future reference, this wound up being a server problem. In case  
anyone has this problem, switching from fcgi to to Passenger solved  
this.
