# Auto\_complete not completing

**URL:** <https://www.ruby-forum.com/t/auto-complete-not-completing/196706>\
**Category:** Rails\
**Created:** [June 9, 2008, 8:31pm UTC](https://www.ruby-forum.com/t/auto-complete-not-completing/196706 "2008-06-09T20:31:34Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [June 9, 2008, 8:31pm UTC](https://www.ruby-forum.com/t/auto-complete-not-completing/196706/1 "2008-06-09T20:31:34Z")

</div>

Here is what I have done.

1. In controller: auto\_complete\_for :search, :string
2. Layouts/search.rhtml \<%=javascript\_include\_tag :defaults %\>
3. Views/search: \<%= text\_field\_with\_auto\_complete ‘search’,  
‘string’, :size =\> 35 %\>

Any idea what I am missing?

Thank you,  
Lynn

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [June 9, 2008, 8:48pm UTC](https://www.ruby-forum.com/t/auto-complete-not-completing/196706/2 "2008-06-09T20:48:49Z")

</div>

lynn wrote:

> Here is what I have done.
> 
> 1. In controller: auto\_complete\_for :search, :string
> 2. Layouts/search.rhtml \<%=javascript\_include\_tag :defaults %\>
> 3. Views/search: \<%= text\_field\_with\_auto\_complete ‘search’,  
> ‘string’, :size =\> 35 %\>
> 
> Any idea what I am missing?

Do you have a public link to the site or is it only on localhost? I  
would like to see the generated HTML

- Carsten

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [June 9, 2008, 8:58pm UTC](https://www.ruby-forum.com/t/auto-complete-not-completing/196706/3 "2008-06-09T20:58:44Z")

</div>

Carsten,

It’s local. Very simple app at this point. I can send you the page  
source if you’d like.

Thanks,  
Lynn

On Jun 9, 2:48 pm, Carsten G. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [June 9, 2008, 9:39pm UTC](https://www.ruby-forum.com/t/auto-complete-not-completing/196706/4 "2008-06-09T21:39:09Z")

</div>

lynn wrote:

> Carsten,
> 
> It’s local. Very simple app at this point. I can send you the page  
> source if you’d like.

Yes try that - I THINK that the problem is in your HTML.

Also have a look at your development.logÂ´. When you type in your input  
field, you should see activity in the log, that it is processing a  
request. If there is no activity, the AJAX request is not sent.

- Carsten

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [June 9, 2008, 9:58pm UTC](https://www.ruby-forum.com/t/auto-complete-not-completing/196706/5 "2008-06-09T21:58:08Z")

</div>

Thanks Carsten. HTML for search and result pages below.

Search page:

 div.auto\_complete { width: 350px; background: #fff; } div.auto\_complete ul { border:1px solid #888; margin:0; padding:0; width:100%; list-style-type:none; } div.auto\_complete ul li { margin:0; padding:3px; } div.auto\_complete ul li.selected { background-color: #ffb; } div.auto\_complete ul strong.highlight { color: #800; margin:0; padding:0; }

search\_results

# Search Results

```
   <li>
    <a href="/search/show/101">data</a></li>

  ....................................................
 </ul>

```

On Jun 9, 3:39 pm, Carsten G. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [June 9, 2008, 10:03pm UTC](https://www.ruby-forum.com/t/auto-complete-not-completing/196706/6 "2008-06-09T22:03:08Z")

</div>

lynn wrote:

…

If I remember correctly, the resulting HTML should be sent without the  
layout.

- Carsten

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [June 9, 2008, 10:08pm UTC](https://www.ruby-forum.com/t/auto-complete-not-completing/196706/7 "2008-06-09T22:08:06Z")

</div>

Carsten,

HTML source in below message.

Not sure what I am looking for in this development log to determine if  
an AJAX request has been sent, but a search for AJAX turned up empty.  
‘handle\_request’ is everywhere.

thanks again,  
Lynn

On Jun 9, 3:39 pm, Carsten G. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)
