Skip to content

adamlogic/jquery-ujs

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

98 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

jquery-ujs

Unobtrusive jQuery with Rails 3

Following versions of jQuery are supported:

  • 1.4

  • 1.4.1

  • 1.4.2

  • 1.4.3

Automated Installation

Step 1

Add this line to your Gemfile:

gem 'jquery-rails'

Step 2

Run this command:

$ rails generate jquery:install # --ui if you want jQuery UI

Manual installation

Step 1

Download jQuery from docs.jquery.com/Downloading_jQuery and put the file in public/javascripts. For example, the file might look like:

public/javascripts/jquery-1.4.3.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. Uncomment following line from 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.

At the top of the page you will see links to jQuery 1.4.1, 1.4.2 and 1.4.3 . By clicking on those links you will be executing the tests against the clicked version of jquery. By default test uses jQuery 1.4.3 .

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 94.8%
  • Ruby 5.2%