We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Use gon to send data to js globally.
It's as simple as writing gon.global instead of gon and the variable will not clear itself after each request. All else remains the same.
gon.global
gon
config/initializers/some_initializer.rb (or any file that can reach Gon constant)
config/initializers/some_initializer.rb (or any file that can reach Gon constant
Gon.global.variable = 'Some data'
in some js which can reach window.gon variable
alert(gon.global.variable)