Permalink
Browse files

Modified namespace

  • Loading branch information...
1 parent 56a1e1b commit bee48eaf49ea23e00fd85a94eba39a3a267206e1 @gazay committed Jan 10, 2012
View
Binary file not shown.
View
Binary file not shown.
View
Binary file not shown.
View
Binary file not shown.
View
@@ -7,8 +7,8 @@ def self.included base
module InstanceMethods
def include_gon(options = {})
- if Gon.request_env && Gon.all_variables.present?
- data = Gon.all_variables
+ if Gon::Sinatra.request_env && Gon::Sinatra.all_variables.present?
+ data = Gon::Sinatra.all_variables
namespace = options[:namespace] || 'gon'
script = "<script>window." + namespace + " = {};"
unless options[:camel_case]
@@ -36,9 +36,9 @@ def self.included base
module InstanceMethods
def gon
- if !Gon.request_env || Gon.request != request.object_id
- Gon.request = request.object_id
- Gon.request_env = request.env
+ if !Gon::Sinatra.request_env || Gon::Sinatra.request != request.object_id
+ Gon::Sinatra.request = request.object_id
+ Gon::Sinatra.request_env = request.env
end
Gon
end

0 comments on commit bee48ea

Please sign in to comment.