lynn3
(lynn)
June 9, 2008, 6:19pm
1
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
11175
(-- --)
June 9, 2008, 6:48pm
2
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
lynn3
(lynn)
June 9, 2008, 6:57pm
3
Carsten,
It's local. Very simple app at this point. I can send you the page
source if you'd like.
Thanks,
Lynn
11175
(-- --)
June 9, 2008, 7:39pm
4
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
lynn3
(lynn)
June 9, 2008, 7:57pm
5
Thanks Carsten. HTML for search and result pages below.
Search page:
<script src="/javascripts/prototype.js?1212690262" type="text/
javascript"></script>
<script src="/javascripts/effects.js?1212690262" type="text/
javascript"></script>
<script src="/javascripts/dragdrop.js?1212690262" type="text/
javascript"></script>
<script src="/javascripts/controls.js?1212690262" type="text/
javascript"></script>
<script src="/javascripts/application.js?1212690262" type="text/
javascript"></script>
<link href="/stylesheets/main.css?1210776622" media="screen"
rel="stylesheet" type="text/css" />
<html>
<header>
</header>
<body>
<p>
<form action="/search/search_results" method="post"><div style="margin:
0;padding:0"><input name="authenticity_token" type="hidden"
value="04d8c182c846392371131641b0a6537a24fd002c" /></div>
<style type="text/css"> 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;
}
</style><input id="search_string" name="search[string]" size="35"
type="text" /><div class="auto_complete"
id="search_string_auto_complete"></div><script type="text/javascript">
//<![CDATA[
var search_string_auto_completer = new
Ajax.Autocompleter('search_string', 'search_string_auto_complete', '/
search/auto_complete_for_search_string', {})
//]]>
</script>
<input name="commit" type="submit" value="Search" />
</form>
</p>
</body>
<footer></footer>
</html>
search_results
<script src="/javascripts/prototype.js?1212690262" type="text/
javascript"></script>
<script src="/javascripts/effects.js?1212690262" type="text/
javascript"></script>
<script src="/javascripts/dragdrop.js?1212690262" type="text/
javascript"></script>
<script src="/javascripts/controls.js?1212690262" type="text/
javascript"></script>
<script src="/javascripts/application.js?1212690262" type="text/
javascript"></script>
<link href="/stylesheets/main.css?1210776622" media="screen"
rel="stylesheet" type="text/css" />
<html>
<header>
</header>
<body>
<html>
<h1>Search Results</h1>
<body>
<ul>
<li>
<a href="/search/show/101">data</a></li>
....................................................
</ul>
</body>
</html>
</body>
<footer></footer>
</html>
lynn3
(lynn)
June 9, 2008, 8:07pm
6
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