Closed jamesstonehill closed 7 years ago
I'm using Rails 5.1.0
This is my manifest file
//= require rails-ujs //= require turbolinks //= require materialize-sprockets //= require_tree .
But I'm getting this error in the console whenever I open my app.
Uncaught ReferenceError: $ is not defined at initial.source-79f269e….js:9
How can I get around this without re-importing jQuery?
add
# Use jquery as the JavaScript library gem 'jquery-rails'
on your Gemfile
or via yarn if you using rails 5.1.* with webpacker
yarn add jquery
then
add on your application.js
//= require jquery
I'm using Rails 5.1.0
This is my manifest file
But I'm getting this error in the console whenever I open my app.
How can I get around this without re-importing jQuery?