There is a service that when I hit it it return me JSON like this, so I think it is returning me the correct JSON I need:

Now in my client contoller I have something simple as this to call the Service and get the JSON back and if I put break points I can see that yes it does have the same JSON posted above
class PharmacyController < ApplicationController
def index
@order_summary = client.get_order_summary(10)
gon.data = @order_summary # my attempt to pass it with GON gem.
end
end
and then in my pharmacy/index.html.erb I am calling my Javascript:
<%= javascript_include_tag 'dummy.js' %>
and my dummy.js javascript file looks like this for now, just to make sure I can see the same number of elements no the array:
$( document ).ready(function() {
var data = gon.data;
console.log( data.length);
});
but what it returns is "undefined"
Do you have any other suggestions for how to achieve this?