passed rails project database data into a javascript array of objects