2
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?

More than 5 years have passed since last update.

【rails】リロードしないとインクリメンタルサーチが動かない時はこれ(turbolinksの無効化)

Posted at

インクリメンタルサーチを実装したのに、
リロードしないと反応しないじゃん!!

ってなったので調べました。

原因はrails5で標準インストールされるturbolinksにあるようです。
(turbolinksについてはこちらの記事を→https://qiita.com/saboyutaka/items/bb089e8208239bf6fdc0)

とりあえず、今回はアプリケーション全体でturbolinksを無効化したかったわけではなく、
リンク先だけで無効化したかったので、以下のように記述して解決しました。

index.html.haml
中略
 = link_to edit_group_path(@group) do
   .main-header__edit-btn{"data-turbolinks": "false"}
     Edit

参考リンク

2
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
2
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?