gazay / gon

Your Rails variables in your JS
MIT License
3.05k stars 184 forks source link

undefined variable include_gon #263

Open Tshamp7 opened 4 years ago

Tshamp7 commented 4 years ago

Hello! Hopefully someone can help me with this because this was going to make implementing stripe a little easier for me! So I tried to install gon so that i could pass variables to my view from my controller and have them be accessible in my JS, but, after installing the gem and defining some variables, I just keep getting and "undefined variable <%= include_gon %>" error message.

Im using the most current version of ruby and rails.

Is there something else I have to do that Im missing?

unixneo commented 3 years ago

This typically happens when you have not included the gon gem, for example, perhaps you forgot to this this to. your code:

gem 'gon', '6.2.0'
require 'gon'