Sometimes this AJAX fires & sometimes it doesn\'t, let me explain.
habit.js
$(document).ready(function() { $(\".habit-check\")
This might be the problem with Turbolinks, could you try changing your javascript:
$(document).ready(function() { // ... }
to look like:
$(document).on("ready page:load", function() { // .. }
Please, let me know if it helped!
Good luck!