・ Ruby: 2.5.7 Rails: 5.2.4 ・ Vagrant: 2.2.7 -VirtualBox: 6.1 ・ OS: macOS Catalina
The following has been implemented.
Delete =
.
By doing this, the javascript file in ʻassets / javascripts` will not be read automatically.
application.js
//Change before
//= require_tree
//Change before
// require_tree
If you want to reflect it in the development environment, development.rb
,
Edit production.rb
if you want to reflect it in the production environment.
development.rb
Rails.application.configure do
#Set the javascript file you want to read individually
config.assets.precompile += ['gmap.js']
#Note that coffeescript will give an error if you add an extension!
config.assets.precompile += ['jquery.jpostal']
end
slim:~.html.slim
/Set the javascript file you want to load on this page
= javascript_include_tag 'gmap.js'
Recommended Posts