Services Spotlight:

Remove, Uninstall, Delete Turbolinks in Rails 4

Written By Corlew Solutions
Updated February 13, 2014
Published February 13, 2014
Why Corlew Solutions?

We write great software and provide amazing technical support. Contact us today if you need help with a software project:

  • Website: Send an inquiry
  • Email:
  • Phone: (703) 688-3058

Article Technology Info

This article discusses the following technologies:

  • Turbolinks - A Ruby on Rails gem that makes following links in your web application faster.
    (github)

Supporting Editors & Tools

The following tools are used in this article:

  • Ruby on Rails - An open source web application framework written in Ruby. (website | docs)

In Rails 4 the Turbolinks gem is included by default for all new projects and it comes with some challenges. While Turbolinks can drastically improve performance for the right type of application, it changes the request/response model many developers expect to be present. In it’s place, it forces a Rails app to function more like a single-page web app where JavaScript state remains between requests.

This decision is similar to Microsoft’s choice to push a radically different (and incomplete) Windows 8 product on their loyal fans. The Rails team has been carving out functionality from Rails core and placing it into separate gems for code they don’t believe is used by the majority of apps. Turbolinks is a valuable resource to have if an app calls for it, but why force this upon apps that don’t need it?

Fortunately, removing Turbolinks is dirt simple. First, open your Gemfile and remove the Turbolinks gem:

1
gem turbolinks

Second, open your application.js file and remove:

1
//= require turbolinks

Last, open up your application.js file and remove the two references to “data-turbolinks-track” => true:

1
2
  <%= stylesheet_link_tag    "application", media: "all", "data-turbolinks-track" => true %>
  <%= javascript_include_tag "application", "data-turbolinks-track" => true %>

We hope you found this article useful. If you see any mistakes, missing features or ways to improve it, please let us know in the comments below so we can update its contents. If you're willing to link to us, we would sincerely appreciate it!

Further Reading

Corlew Solutions is a Web Design and Web Application Development company based in Fairfax Virginia, minutes away Washington D.C. If you're looking for great web design from the Northern Virginia area or web design from the Washington D.C. area we can help. Contact Us today!

comments powered by Disqus