We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents baa9722 + 83cd75e commit f63eb75Copy full SHA for f63eb75
lib/gon/helpers.rb
@@ -10,8 +10,9 @@ def include_gon
10
11
script = "<script>function Gon(){"
12
data.each do |key, val|
13
- script += "this." + key.to_s + "'" + val.to_s + "';"
14
- end
+ val = "'#{val}'" if val.instance_of? String
+ script += "this." + key.to_s + val.to_json + ";"
15
+ end
16
script += "}; var Gon = new Gon()</script>"
17
script.html_safe
18
end
0 commit comments