If you have a page of jquery that works the first time you load it, but disappears thereafter
(except for full page refreshes) see if you need to add this gem to your project:

https://github.com/kossnocorp/jquery.turbolinks

Turbolinks is a gem used in rails asset pipeline to make your apps fast. It does this by caching only body and title on your pages.

But javascript won’t get reloaded. So if you are using jquery you need something to keep your javascript bind events alive.

That’s what this gem does.

You can read more about jquery and turbolinks here:

https://github.com/kossnocorp/jquery.turbolinks
https://github.com/rails/turbolinks#jqueryturbolinks