# In\_place\_editor with local autocomplete

**URL:** <https://www.ruby-forum.com/t/in-place-editor-with-local-autocomplete/60623>\
**Category:** Rails\
**Created:** [May 16, 2006, 9:56am UTC](https://www.ruby-forum.com/t/in-place-editor-with-local-autocomplete/60623 "2006-05-16T09:56:21Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![dean](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/3be4f8/32.png) [@dean](https://www.ruby-forum.com/u/dean)\
**Post date:** [May 16, 2006, 9:56am UTC](https://www.ruby-forum.com/t/in-place-editor-with-local-autocomplete/60623/1 "2006-05-16T09:56:21Z")

</div>

Hi Rails gals n guys

I am trying to enhance the “Lightning-Fast JavaScript Autocompletion”  
rails recipe. For those that do not have the pdf-book the recipe  
explains how to use a javascript array for an auto-complete text field.

I want to combine this with the in\_place\_editor call. My current  
(unworking) code:

Change Style

\<%= in\_place\_editor( “style\_lookup”, { :url =\> url\_for( :controller =\>  
“styles”, :action =\> “style\_jdetails” ), :script =\> true } ) %\>

\<%= javascript\_tag(“new Autocompleter.Local( ‘style\_lookup’ ,  
‘style\_auto\_complete’, styleArray, { fullSearch: true, frequency: 0,  
minChars: 1 });”) %\>

The problem here is that in\_place\_editor creates an input tag with no  
id, so the Autocompleter can not find it.

Even if I could get the in\_place\_editor to id the input, would the  
Autocompleter work since the input tag does not exist when the document  
loads?

Sounds like I’m going to have to create two divs, one with value and one  
with input, and switch their visibility. Other suggestions?

Thanks,  
–Dean
