Easily Replace Prototype and Scriptaculous with JQuery
There is a very cool gem called jquery-rails which provides you one rails generator which will replace your Prototype and Scriptaculous JavaScript libraries with JQuery, within your Rails app. It will download JQuery and install it for you under your public/javascripts directory.
I believe this gem only works with Rails 3. I’ve only tested it with Rails 3.
The generator of the current version of jquery-rails v. 0.26 will download and install JQuery 1.4.2. However, the latest version of JQuery is 1.4.4.
jquery-rails’s generator allows you to specify the version of JQuery to download and install via the –version flag.
- Install jquery-rails gem
gem install jquery-rails
- Add gem jquery-rails to your Gemfile
gem "jquery-rails"
- Install jquery-rails via Bundler
bundle install
- Use the jquery-rails generator to replace prototype and scriptaculous JavaScript libraries with JQuery’s. Specify the latest JQuery version (i.e. 1.4.4)
rails generate jquery:install --version=1.4.4
Figure out the latest version of JQuery here. You can Download jquery-rails here
Easily Replace Prototype and Scriptaculous with JQuery,