2. What’s Wiselinks
• Is a gem likes Turbolinks to make page loads
faster by using AJAX and history APIs as
pushState to replace the content of page
instead of re-rendering all of the page
• pushState is a method of History API (HTML5)
allows Javascript to store data in session
history with title & url
• Turbolinks is shipped as default in Rails 4
3. The difference with Turbolinks
• Wiselinks work as a whitelist when Turbolinks
work as blacklist
• Processes 30x http redirects
• Works in browers that don’t have History API
• Can handle form processing
4. Installation
• Add “ gem ‘wiselinks’ ” to Gemfile then
bundle
• Add “//= require wiselinks” and create
wiselinks object “window.wiselinks = new
Wiselinks()” in application.js
• Add attribute “ data-push=‘true’ ” to link want
to use wiselink
6. Notes
• Use ‘wiselinks_title’ helper to set title of page
• Problem when using ‘document.ready’
• Event: ‘page:loading’, ‘page:redirected’,
‘page:always’, ‘page:done’, ‘page:fail’