Rails 4 now comes with Turbolinks enabled by default, I think this is great and would love to see more sites make use of this technology if it’s feasable.
Hooking this up if your using middleman couldn’t be any easier, as middleman has sprokets built in.
Require the turbolinks gem
Add the following line to your Gemfile and then run
bundle to install it
gem "turbolinks", require: false
<head> section of your layouts/layout.erb
Pull in the turbolinks JS
Now that you have your JS file being successfully loaded you can require turbolinks, add the following line to the top of your application.js file:
//= require turbolinks
You’re now running a static site with turbolinks. I’ve found this improves the perceived speed of my site a lot, hopefully it can do the same for you. If you have any questions please leave them below.