The case is very simple, I just want to format the json result like this:
<%= @cal_dvp_status.to_a.map {|k| [Domain.find(k[0]).name,k[1][0],k[1][1],k[1][2],k[1][3]] } %>
@cal_dvp_status is a hash type, so I transfer it by to_a. I need the first column should be Domain's name, the others are number type. But I don't know why the json can't work. But if I just insert the k[0], which is number type, it works.
<%= @cal_dvp_status.to_a.map {|k| [k[0],k[1][0],k[1][1],k[1][2],k[1][3]] } %>
I don't know why the code doesn't work right now.