1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Rails7でjQueryを使えるようにする

Posted at

導入手順

importmapにjqueryを追加する

console
bin/importmap pin jquery

動作確認も含めて以下を追加

javascript/application.js
import jquery from "jquery"
window.$ = jquery

$(function(){
  alert('ok');
});

ちゃんと動いていたらページを更新すると
アラートが表示されます。

簡単だけどimportmapが全然わからないときめっちゃ困ったから書きました。

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?