Topic: Using ruby arrays in javascript

I would like to pass a ruby array as an argument for a javascript function triggered by onmouseover.
How can I do this? I know javascript can get the arguments array, but do I need to use Array.join(,) , or can I pass it directly? And what if the array I need to pass is multidimensionnal?

Re: Using ruby arrays in javascript

Have a look at the inspect method from arrays:
http://corelib.rubyonrails.org/classes/ … ml#M000391

The string it prints is the same as when you create an array in javascript.

Last edited by Dieter Komendera (2006-09-29 10:25:17)

My homepage: http://www.komendera.com/
Working at: http://www.abloom.at/
My blog: soaked and soaped http://soakedandsoaped.com/

Re: Using ruby arrays in javascript

oh, thanks!