Turbolinks
suggest changeIntroduction
Turbolinks is a javascript library that makes navigating your web application faster. When you follow a link, Turbolinks automatically fetches the page, swaps in its <body>, and merges its <head>, all without incurring the cost of a full page load.
Remarks
As a rails developer, you will likely interact minimally with turbolinks during your development. It is, however, an important library to be familiar with because it can be the cause of some hard-to-find bugs.
Key takeaways:
- Bind to the
turbolinks:loadevent instead of thedocument.readyevent - Use the
data-turbolinks-falseattribute to disable turbolink functionality on a per-link basis. - Use the
data-turbolinks-permanentattribute to persist elements across page loads and to avoid cache-related bugs.
For a more in-depth treatment of turbolinks, visit the official github repository.
Credit for much of this documentation goes to the folks who drafted the turbolinks documentation on the github repository.
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents