Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

In sinatra doesn't exist helper 'to_json'

  • Loading branch information...
commit 118334781790c1f5aa84993bb8e086d1cba95113 1 parent 3ca1d53
@gazay authored
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/gon/sinatra/helpers.rb
View
4 lib/gon/sinatra/helpers.rb
@@ -13,11 +13,11 @@ def include_gon(options = {})
script = "<script>window." + namespace + " = {};"
unless options[:camel_case]
data.each do |key, val|
- script += namespace + "." + key.to_s + '=' + val.to_json + ";"
+ script += namespace + "." + key.to_s + '=' + val.to_s + ";"
end
else
data.each do |key, val|
- script += namespace + "." + key.to_s.camelize(:lower) + '=' + val.to_json + ";"
+ script += namespace + "." + key.to_s.camelize(:lower) + '=' + val.to_s + ";"
end
end
script += "</script>"
Please sign in to comment.
Something went wrong with that request. Please try again.