Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Usage gon global

kennethtransier edited this page · 2 revisions

Use gon to send data to js globally.

It's as simple as writing instead of gon and the variable will not clear itself after each request. All else remains the same.

config/initializers/some_initializer.rb (or any file that can reach Gon constant) = 'Some data'

in some js which can reach window.gon variable

Something went wrong with that request. Please try again.