$( document ).on('turbolinks:load', function() {
	if ($('#desktopTest').is(':hidden')) {
	    	$('.desktop').attr("hidden", true);
		} else {
				$('.mobile').attr("hidden", true);
		}
})
$( document ).on('turbolinks:load', function() {
	if ($('#desktopTest').is(':hidden')) {
	    	$('.desktop').remove();
		} else {
				$('.mobile').remove();
		}
})
Remove unused templates from DOM instead of hiding
Remove unused templates from DOM instead of hiding
