Home>
Question
I have recently started using version 6 of rails and have questions about application.js
I asked you two questions.
(1) Location of application.js
Has the location of the application.js file changed in rails 5 and 6?
rails5➡ [project] /app/assets/javascripts/application.js
rails6➡ [project] /app/javascript/application.js
(2) How to write require in application.js file
Has the format of require changed between rails 5 and 6?
// = require rails-ujs
// = require turbolinks
// = require_tree.
require ("@ rails/ujs"). start ()
require ("turbolinks"). start ()
require ("@ rails/activestorage"). start ()
require ("channels")
Thanks.
-
Answer # 1
Related articles
- ruby on rails - about the description in applicationjs
- javascript - about switching the display between desplay: none;and desplay: block;
- [javascript] about source control
- ruby on rails - about nomethoderror in skilscontroller # create
- ruby - about rails controller new action
- [javascript] please tell me about the code to format json data such as deduplication
- javascript - about vuejs components
- javascript - about the problem that it disappears when trying to pass the contents of the state of reactjs with props
- ruby on rails - about request spec of rspec about test code at login
- javascript rails pushes irrelevant buttons
- javascript - questions about gas scripts
- javascript - sprockets :: rails :: helper :: assetnotfound in skils # show
- ruby on rails - about the error when trying to implement jquery with rails ($is not defined;please fix or add/* global * /)
- [javascript] about date type comparison
- javascript - about the order of reading external files
- about javascript syntax
- javascript - image acquisition by axios in rails api mode
- ruby - rails you have included the google maps javascript api multiple times on this page
- about javascript for statement
- javascript - about html autocomplete feature
Trends
Both (1) and (2) have changed. It is the influence that Webpacker became the default in Rails6. Search with Rails6, Webpacker for more details.