2 ms·The trite answer is to_json. The more substantial answer is to use a Javascript generator like RJS.by zach 17y agoThe trite answer is to_json. The more substantial answer is to use a Javascript generator like RJS.