got data from pg to erb to js