1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

[Rails7]JavaScriptでTurboを無効化する方法

Posted at

リロードしないとJavaScriptが動かない

Rails7のTurboが原因。
JSファイルでturbo:loadイベントを使用する。

test.js
document.addEventListener('turbo:load', function() {
  console.log('turbo無効化');
});

turbolinksではなくturboなので気をつけてください。

参考

1
0
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
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?