Every day (pretty much) the ruby-on-rails tag gets questions about JavaScript only working after a page refresh. The problem is (almost) always the turbolinks
gem that is included with Rails. I'd like to turn this question into a good canonical question so the other ones can be closed as duplicates. I chose that one because it has the best, most google-able title.
Is this a good question to use? Should I edit the question to make it a little more universal (i.e. removing most of the JavaScript except for $(document).ready ->
, which is the problem)? Should I write a new question and answer it myself?
I get tired of these questions, but it is obvious that a lot of people are confused about turbolinks
so I'd like to be able to direct them to a single question that should help them without polluting the site with a bunch of similar turbolinks
-related questions.