Skip to content

Instantly share code, notes, and snippets.

@brooklynDev
Created February 15, 2012 20:23
Show Gist options
  • Save brooklynDev/1838771 to your computer and use it in GitHub Desktop.
Save brooklynDev/1838771 to your computer and use it in GitHub Desktop.
#Controller
def HomeController < ApplicationController
def index
gon.myVar = 100
end
end
#home.html.erb
<%= include_gon %>
<script type="text/javascript">
$(function(){
alert(gon.myVar);
})
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment