How do I pass the ruby arrays to Js func and access it(from JS func)from a view page.. In my view page I have defined an array as
<% asset_org.push({'url' => image_data['url'],
'height' => height_org,
'width'=> width_org
}) %>
And I have passed this array as
<%= submit_tag "Create Slideshow",:Onclick=>"insert_slide(#{asset_org['height'].to_json}, #{asset_org['width'].to_json)" %>
But in the JS function(defined as function insert_slide(height, width)) of insert_slide I am not able to access this array of height and width
It is showing an error as asset_org is not defined... Any inputs on this??