Tutorial by Examples

With turbolinks, the traditional approach to using: $(document).ready(function() { // awesome code }); won't work. While using turbolinks, the $(document).ready() event will only fire once: on the initial page load. From that point on, whenever a user clicks a link on your website, turbolink...
It is very easy to disable turbolinks on specific links. According to the official turbolinks documentation: Turbolinks can be disabled on a per-link basis by annotating a link or any of its ancestors with data-turbolinks="false". Examples: // disables turbolinks for this one link ...
Application visits are initiated by clicking a Turbolinks-enabled link, or programmatically by calling Turbolinks.visit(location) By default, the visit function uses the 'advance' action. More understandably, the default behavior for the visit function is to advance to the page indicated by the ...
Turbolinks provides an event listener that can be used to stop visits from occurring. Listen to the turbolinks:before-visit event to be notified when a visit is about to commence. In the event handler, you can use: // pure javascript event.data.url or // jQuery $event.originalEvent.data.url...
Consider the following situation: Imagine that you are the developer of a social media website that allows users to be friends with other users and that employs turbolinks to make page loading faster. In the top right of every page on the site, there is a number indicating the total number of friend...

Page 1 of 1