Use jQuery Turbolinks.
"if you have a large codebase with lots of
$(el).bind(...)
Turbolinks will surprise you. Most part of your JavaScripts will stop working in usual way. It's because the nodes on which you bind events no longer exist."
Usage:
# Gemfile:
gem 'jquery-turbolinks'
# JavaScript manifest file:
//= require jquery.turbolinks
Perhaps, at some point, the jQuery $.widget
function will offer an option to bind differently, but until then, this works. No other changes to the Javascript are required.