i’ve js file that holds Array objects and data assigns
var A_1_val = new Array(7);
var B_1_txt = new Array(7);
A_1_val[0] = '111';
B_1_txt[0] = 'utf8_content';
A_1_val[1] = '222';
B_1_txt[1] = 'bar';
etc..
need to get these arrays in ruby.
found http://github.com/jbarnette/johnson, but it can’t correctly return an array object
another way is to eval js in ruby, similar to
-
get name of arrays
-
cut arrays initialize from js
-
ruby eval
A_1_val[0] = ‘111’
B_1_txt[0] = ‘utf8_content’
both ways are sucks. maybe you can suggests any ideas
thanks
You can use a JSON string to marshal the data between javascript and ruby:
which gives the output: