Piyush Gupta
2007-Sep-20 09:25 UTC
lignhtning fast autocompleter IE issue (script save call)
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
<head>
<%= javascript_include_tag :defaults %>
<script src="/book/authors_for_lookup"
type="text/javascript"></script>
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
..
<head>
<%= javascript_include_tag :defaults %>
<script type="text/javascript">
var authors = new Array(<%= @authors.size %>);
<% @authors.each_with_index do |author, index| %>
authors[<%= index %>] = "<%= author.name %>";
<% end %>
</script>
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
mba.piyushgupta-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
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
<Bangalore>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Spinoffs" group.
To post to this group, send email to
rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---
Piyush Gupta
2007-Sep-20 09:25 UTC
lignhtning fast autocompleter IE issue (script save call)
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
<head>
<%= javascript_include_tag :defaults %>
<script src="/book/authors_for_lookup"
type="text/javascript"></script>
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
..
<head>
<%= javascript_include_tag :defaults %>
<script type="text/javascript">
var authors = new Array(<%= @authors.size %>);
<% @authors.each_with_index do |author, index| %>
authors[<%= index %>] = "<%= author.name %>";
<% end %>
</script>
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
mba.piyushgupta-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
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
<Bangalore>
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---
Pratik
2007-Sep-20 09:30 UTC
Re: [ Bangalore RUG] lignhtning fast autocompleter IE issue (script save call)
Stop doing this. You''ve sent the same email to 10 groups. On 9/20/07, Piyush Gupta <mba.piyushgupta-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> 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 > <head> > <%= javascript_include_tag :defaults %> > <script src="/book/authors_for_lookup" > type="text/javascript"></script> > > 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 > .. > <head> > <%= javascript_include_tag :defaults %> > <script type="text/javascript"> > var authors = new Array(<%= @authors.size %>); > <% @authors.each_with_index do |author, index| %> > authors[<%= index %>] = "<%= author.name %>"; > <% end %> > </script> > > 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 mba.piyushgupta-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org > > 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 > <Bangalore> > > > > >-- Cheers! - Pratik http://m.onkey.org --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---