# Lignhtning fast autocompleter IE issue (script save call)

**URL:** <https://www.ruby-forum.com/t/lignhtning-fast-autocompleter-ie-issue-script-save-call/115071>\
**Category:** Ruby\
**Created:** [September 20, 2007, 11:25am UTC](https://www.ruby-forum.com/t/lignhtning-fast-autocompleter-ie-issue-script-save-call/115071 "2007-09-20T11:25:38Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jhonny](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/919ad9/32.png) [@jhonny](https://www.ruby-forum.com/u/jhonny)\
**Post date:** [September 20, 2007, 11:25am UTC](https://www.ruby-forum.com/t/lignhtning-fast-autocompleter-ie-issue-script-save-call/115071/1 "2007-09-20T11:25:38Z")

</div>

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)  
response.headers[’ content-type’] = ’ text/javascript’  
end

but when i tried sourcing the jjs file through the html file it wasnt  
able  
to find the js file  
so i placed the script in the head section of the rhtml file somewhat  
like  
…

\<%= javascript\_include\_tag :defaults %\>

it works fine in Mozilla firefox any version  
but i get error while i use Internet explorer 7.0 and lower .  
it asks me to save the file  
i think theres some problem with the response.headers which we are using  
in  
the controller

can some one give me a solution  
please feel free to reply or mail me at removed\_email\_address@domain.invalid

thank you

## PS.Can someone explain what does this response.headers do i tried @headers but that was deprecated in the latest version of rails.

JON  
09916133729

---

<div class="post-metadata">

**Author:** ![jhonny](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/919ad9/32.png) [@jhonny](https://www.ruby-forum.com/u/jhonny)\
**Post date:** [September 20, 2007, 11:31am UTC](https://www.ruby-forum.com/t/lignhtning-fast-autocompleter-ie-issue-script-save-call/115071/2 "2007-09-20T11:31:39Z")

</div>

Stop doing this. You’ve sent the same email to 10 groups.

On 9/20/07, Piyush G. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> response.headers[’ content-type’] = ’ text/javascript’  
> \<% @authors.each\_with\_index do |author, index| %\>  
> can some one give me a solution
> 
> >

–  
Cheers!

- Pratik  
[http://m.onkey.org](http://m.onkey.org)
