Skip to content

Instantly share code, notes, and snippets.

@kisp
Created February 12, 2024 21:44
Show Gist options
  • Save kisp/1c7ac0d563da096c01834fd2ab00ece3 to your computer and use it in GitHub Desktop.
Save kisp/1c7ac0d563da096c01834fd2ab00ece3 to your computer and use it in GitHub Desktop.
Disable page prefetching when hovering with the mouse over links in turbo for Rails 7
// app/javascript/application.js
// Configure your import map in config/importmap.rb. Read more: https://github.com/rails/importmap-rails
import "@hotwired/turbo-rails"
import "controllers"
// Add this line
Turbo.session.linkPrefetchObserver.stop()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment