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 --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
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 -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
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 Gehling <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> 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 > -- > Posted viahttp://www.ruby-forum.com/.--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
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 -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
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>
On Jun 9, 3:39 pm, Carsten Gehling
<rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org>
wrote:> 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
> --
> Posted viahttp://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---
lynn wrote: ... If I remember correctly, the resulting HTML should be sent without the layout. - Carsten -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
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 Gehling <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> 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 > -- > Posted viahttp://www.ruby-forum.com/.--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---