@rwz How? Using rails 3.2.12 I just copied this into an erb template `var a = <%= Jbuilder.new { |j| j.foo 'bar' }.target! %>;` and received this in the markup `var a = {&quot;foo&quot;:&quot;bar&quot;};`.