Removing Turbolinks from a Ruby on Rails 4 Project
December 11, 2013
Turbolinks was a new feature introduced in Ruby on Rails 4 that attempts to bridge the gap between server-side applications and client-side applications. It provides some interesting functionality, but can often cause more trouble than it’s worth. Luckily, it can easily be removed from a project if required.
gem 'turbolinks'from your Gemfile and run
//= require turbolinksfrom
- Remove both instances of
"data-turbolinks-track" => truefrom
Slightly More Automated Removal
I’ve also created a gem called remove_turbolinks to automate this process. It provides a command to automatically handle the removal of Turbolinks for you.
gem 'remove_turbolinks'to your Gemfile and run
rails g remove_turbolinks:removeto remove all references to Turbolinks in your project.
It’s as easy as that to remove Turbolinks from your Ruby on Rails project. Turbolinks is an interesting technology, so it’s worth trying before your decide to remove it.