Turbo or no Turbo?

I started my Rails/JQuery project for Flatiron School and found that I didn’t really need Turbolinks®. I understand that it optimizes web navigation, but it also prevented me from using ‘debugger’ to find the information I needed to complete my project. For example, I started to use JQuery and AJAX to get data and manipulate the DOM for a ‘favorite’ and ‘unfavorite’ button.

I’m not saying Turbolinks® is a bad thing. I’m still new to Rails and JQuery and I didn’t want to use more power than I could handle. I know my limitations as Clint Eastwood has said in one of his movies that I can’t remember the title.

via GIPHY

So, I figured I would go without Turbolinks® in my Rails/JQuery project and the following steps are what I took:
1. Uninstall the gem
2. Take out any links in the application.html.erb file and make sure your javascript and stylesheet tags are still in your code because your styles could disappear and javascript debugger will either be wonky or won’t work at all. My code was:
“`
<%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %>

<%= javascript_include_tag 'application', 'data-turbolinks-track': 'reload' %>
“`
And I changed it to:
“`
<%= stylesheet_link_tag 'application', media: 'all' %>

<%= javascript_include_tag 'application' %>
“`
3. Take out the ‘data-turbolinks-track’: ‘reload’ to make the app work without the turbolinks.
4. Comment out the gem out in my gemfile ran gem uninstall turbolinks.
I think that’s about it. Now it should run smoothly. I will research Turbolinks® and see how advantageous it will be for me in the future.

Leave a Reply

Your email address will not be published. Required fields are marked *