File tree Expand file tree Collapse file tree 3 files changed +6
-5
lines changed
Expand file tree Collapse file tree 3 files changed +6
-5
lines changed Original file line number Diff line number Diff 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
Original file line number Diff line number Diff 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
Original file line number Diff line number Diff line change 11module Gon
2- VERSION = '0.1.0 '
2+ VERSION = '0.1.1 '
33end
You can’t perform that action at this time.
0 commit comments