Topic: Passing in Ruby Array to Javascript

I have an array that I created in my controller called @boundary_Count and I am trying to use these as an input parameter to my javascript function, function init(totalArray){}.  Currently here is what my view looks like when I attempt the call, I've tried two ways without success:

<body onload="init(<%=@boundary_Count.to_json%>)">


<body onload="init(#{@boundary_Count.to_json})">

Re: Passing in Ruby Array to Javascript

<body onload="init(<%=escape_javascript(@boundary_Count.to_json) %>)">

Joe got a job, on the day shift, at the Utility Muffin Research Kitchen, arrogantly twisting the sterile canvas snout of a fully charged icing anointment utensil.