$.datepicker.initialized = false
This will tell jQuery-UI that it has to add those dom elements again.
At this point you might be thinking “Turbolinks is stupid and should do that for us.” Here’s why that thinking is wrong: Turbolinks does one, very specific thing; it ajaxes links and replaces (and caches) the current body content with the body content that gets returned from the server. Knowing that that’s what it does, it is our responsibility to make sure the other libraries we use (or our own code) plays nicely with that paradigm. If we want to avoid that paradigm we can choose not to use Turbolinks, perhaps using Pjax or nothing instead.
I think in this case the jQuery-UI library could be smarter and rather than maintain a variable they could actually check to see if their dom elements exist (I’m guessing they check the variable for performance reasons).
If you wanted it to build a product you’d find a way to get time to work on it. If you really wanted to start that new hobby you’d sacrifice something to find the time and money to do it.
I'll define a "Wannabe Entrepreneur" as someone who has never made money from their businesses. Here are the different types of wannabes.
In the past few years I've built go-carts, built a 200+ sq ft workshop, written several eBooks. How do I create a life where I have time to work on side projects?
Receive 5 Software projects mistakes we have made over the years and how to avoid them.