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.
Then run a bundle install.
Finally, tell Rails to include the jquery-turbolinks script. Make sure to do this right after the jquery include.
//= require jquery.turbolinks
Once you restart your Rails server, JQuery should be working again. See https://github.com/kossnocorp/jquery.turbolinks for more details.