macOS Catalina version 10.15.4 ruby 2.5.1p57 (2018-03-29 revision 63029) Rails 5.2.4.3
Check the Gemfile and
gem "jquery-rails"
It is described as.
In application.js,
//= require jquery
It is described as. * As a caveat, write above "// = require_tree."
//= require jquery
//= require_tree .
Check if jQuery can actually be used. Create a js file with any name. (If there is a coffee file with the same name, delete it.)
$(function(){
console.log('OK');
});
Now refresh the page and if the console says'OK', you're ready to go!
Recommended Posts