using rails way of json