Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Ruby Object To JavaScript Object

DZone's Guide to

Ruby Object To JavaScript Object

·
Free Resource
Convert a Ruby object to a JavaScript object.
Requires Rails and prototype.js

 javascript_object = "<%= 
   ruby_object.to_json.gsub('\\','\\\\\\\\').gsub('"', '\\"') 
%>".evalJSON()
Topics:

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}