I\'m trying to install jQuery in Rails 6.0.0.rc1 via Webpack and I\'m not sure what I\'m missing but I\'m getting the error $ is not defined in the browser console
$ is not defined
The code in config/webpack/environment.js should look like this:
config/webpack/environment.js
environment.plugins.prepend('Provide', new webpack.ProvidePlugin({ $: 'jquery/src/jquery', jQuery: 'jquery/src/jquery' }) )
see also https://www.botreetechnologies.com/blog/introducing-jquery-in-rails-6-using-webpacker