デベロッパーツールのコンソールでapplication.jsの console.log('yeah, we are ready!')を表示させたい。
application.js require("@rails/ujs").start() require("turbolinks").start() require("jquery") require("@rails/activestorage").start() require("channels") // Uncomment to copy all static images under ../images to the output folder and reference // them with the image_pack_tag helper in views (e.g <%= image_pack_tag 'rails.png' %>) // or the `imagePath` JavaScript helper below. // // const images = require.context('../images', true) // const imagePath = (name) => images(name, true) $(document).on('turbolinks:load', function () { console.log('yeah, we are ready!') })
environment.js const { environment } = require('@rails/webpacker') const webpack = require('webpack') environment.plugins.prepend('Provide', new webpack.ProvidePlugin({ $: 'jquery', jQuery: 'jquery' }) ) module.exports = environment
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2020/03/22 04:29