Over a million developers have joined DZone.

Ruby Object To JavaScript Object

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

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

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

{{ parent.tldr }}

{{ parent.urlSource.name }}