Skip to content

Commit 12895af

Browse files
committed
Minimal fixes
1 parent b497f5c commit 12895af

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ If you need to send some data to your js files and you don't want to do this wit
99
``` erb
1010
<head>
1111
<title>some title</title>
12-
<gon style='display:none'><%= gon_variables %></gon>
12+
<%= gon_variables %>
1313
<%= javascript_include_tag 'http://code.jquery.com/jquery-1.6.min.js' %> <!-- include jquery -->
14-
<%= include_gon %>
14+
<%= include_gon_js %> <!-- http://gaziev.com/files/gon.js -->
1515
...
1616
```
1717

lib/gon/helpers.rb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,15 @@ def self.included base
55
end
66

77
module InstanceMethods
8-
def include_gon
8+
def include_gon_js
99
javascript_include_tag 'http://gaziev.com/files/gon.js'
1010
end
1111

1212
def gon_variables
1313
data = Rails.cache.read('gon_variables') || {}
1414

15-
data.to_s.gsub('=>', ' : ')
15+
'<gon style="display:none">' + data.to_s.gsub('=>', ' : ') +
16+
'</gon>'
1617
end
1718
end
1819

lib/gon/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module Gon
2-
VERSION = '0.1.0'
2+
VERSION = '0.1.1'
33
end

0 commit comments

Comments
 (0)