[導入]
①carrierwaveのインストール
gem "carrierwave"
bundle install + rails s を忘れずに
②動画専用のクラスの生成
rails g uploader video
「rails g uploader + クラス名」で生成します。
🗂 → app/uploaders/video_uploader.rb# Add an allowlist of extensions which are allowed
webpackerでjQueryを管理してjavascriptを書きやすくする
[javascriptだけで記述した場合] (before)
window.onload = function () { document.querySelector("h2").addEventListener("mouseover", function (event) { this.style.color = "lightblue" }, false); document.querySelector("h2").addEventListener("mou