After updating your app to Rails 4.0 you may discover that JQuery appears to be broken. This is usually due to turbolinks being included. Rather than disable turbolinks, add the jquery-turbolinks gem to your gemfile.

Gemfile:

gem 'jquery-turbolinks'

Then run a bundle install.

Terminal Commands

bundle install

Finally, tell Rails to include the jquery-turbolinks script. Make sure to do this right after the jquery include.

app/assets/javascripts/application.js:

//= require jquery.turbolinks

Once you restart your Rails server, JQuery should be working again. See https://github.com/kossnocorp/jquery.turbolinks for more details.