# Array\_or\_string\_for\_javascript

**URL:** <https://www.ruby-forum.com/t/array-or-string-for-javascript/80992>\
**Category:** Rails\
**Created:** [January 2, 2007, 9:58pm UTC](https://www.ruby-forum.com/t/array-or-string-for-javascript/80992 "2007-01-02T21:58:04Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ksteiger](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/f1d935/32.png) [@ksteiger](https://www.ruby-forum.com/u/ksteiger)\
**Post date:** [January 2, 2007, 9:58pm UTC](https://www.ruby-forum.com/t/array-or-string-for-javascript/80992/1 "2007-01-02T21:58:04Z")

</div>

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)  
%\>

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

---

<div class="post-metadata">

**Author:** ![ksteiger](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/f1d935/32.png) [@ksteiger](https://www.ruby-forum.com/u/ksteiger)\
**Post date:** [January 2, 2007, 10:02pm UTC](https://www.ruby-forum.com/t/array-or-string-for-javascript/80992/2 "2007-01-02T22:02:58Z")

</div>

Never mind… seems restarting mongrel fixed the problem.
