Auto_complete not completing

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

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

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. [email protected]

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

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. [email protected]

lynn wrote:

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

  • Carsten

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. [email protected]