Processes data array in ruby and dumps it as json into browser