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.

  1. Install jquery-rails gem
    gem install jquery-rails
  2. Add gem jquery-rails to your Gemfile
    gem "jquery-rails"
  3. Install jquery-rails via Bundler
    bundle install
  4. 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

VN:F [1.9.22_1171]
Rating: 3.0/5 (3 votes cast)
VN:F [1.9.22_1171]
Rating: +2 (from 2 votes)
Easily Replace Prototype and Scriptaculous with JQuery, 3.0 out of 5 based on 3 ratings
Facebook Twitter Email

Leave a Reply