Hi friends, I was using the rails recipes for the feature called Lightning fast auto completer where we search and save the contents to be displayed in the JavaScript Array .
something like in some .js file var authors = new Array(<%= @authors.size %>); <% @authors.each_with_index do |author, index| %> authors[<%= index %>] = “<%= author.name %>”;
<% end %>
and do this in the head section the rhtml file
<%= javascript_include_tag :defaults %>and in the controller def authors_for_lookup @authors = Author.find(:all) @headers[’ content-type’ ] = ’ text/javascript’ end