Forum: Ruby on Rails array_or_string_for_javascript

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Kris S. (Guest)
on 2007-01-02 22:58
Rails Newby here.
I am trying to send an array to array_or_string_for_javascript. I get
this error:
wrong number of arguments (1 for 0)

Below is my code:
<%
    @img = Array.new
    @project.images.find(:all).each do |g|
      @img << g.image
    end
     array_or_string_for_javascript(@img)
    %>
<script> var jVar = <%= array_or_string_for_javascript(options[:img])
%>; </script>

Kind of baffled by this, basically i simply want to populate a
javascript array with image path's from my db.

Any help would be greatly appreciated.
Thanks
Kris S. (Guest)
on 2007-01-02 23:02
Never mind.... seems restarting mongrel fixed the problem.
This topic is locked and can not be replied to.