Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
JavaScript Ruby
branch: master

This branch is 1 commit ahead, 390 commits behind rails:master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
src
test
.gitignore
Gemfile
README.rdoc

README.rdoc

jquery-ujs

Unobtrusive jQuery with Rails 3

Installation

jQuery 1.4, 1.4.1 and 1.4.2 can be used. However because of jsbin.com/uboxu3/7/ issue it is recommended to use jQuery 1.4.1.

Step 1

Download jQuery from docs.jquery.com/Downloading_jQuery and put the file in public/javascripts - for example, the file might be:

public/javascripts/jquery-1.4.1.min.js

Step 2

Copy rails.js from github.com/rails/jquery-ujs/raw/master/src/rails.js into public/javascripts - overwriting the prototype one (you can also delete the other prototype files if you don't need them for anything else.)

Step 3 (optional)

Switch the javascript_include_tag :defaults to use jquery instead of the default prototype helpers.

file config/application.rb

config.action_view.javascript_expansions[:defaults] = %w(jquery rails application)

Testing

Installation

$ gem install bundler
$ bundle install

Running tests

$ bundle exec ruby test/server.rb

Visit localhost:4567 and all the tests should pass. If you want to change any settings then change the settings at the top of test/public/test/settings.js

Something went wrong with that request. Please try again.