Permalink
Browse files

In sinatra doesn't exist helper 'to_json'

  • Loading branch information...
1 parent 3ca1d53 commit 118334781790c1f5aa84993bb8e086d1cba95113 @gazay committed Jan 10, 2012
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>"

0 comments on commit 1183347

Please sign in to comment.