Skip to content

Commit 5917d1d

Browse files
committed
explain how to use both Rails 3.0 and 3.1 in the readme
1 parent 3ddc02c commit 5917d1d

File tree

1 file changed

+19
-3
lines changed

1 file changed

+19
-3
lines changed

README.md

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# Jquery-rails
22

3-
This gem provides jQuery 1.5.2 and the latest jQuery UJS adapter for Rails 3.1 and greater. The files will be added to the asset pipeline and available for you to use. For example, you can require them by adding these two lines to the file `app/assets/javascripts/application.js`:
3+
## Rails 3.1
4+
5+
This gem vendors jQuery 1.6 and the latest jQuery UJS adapter for Rails 3.1 and greater. The files will be added to the asset pipeline and available for you to use. For example, you can require them by adding these two lines to the file `app/assets/javascripts/application.js`:
46

57
//= require jquery
68
//= require jquery_ujs
@@ -13,8 +15,22 @@ When you generate a new Rails 3.1 app, pass the `-j jquery` option, like this:
1315

1416
rails new myapp -j jquery
1517

16-
Your new app's Gemfile will have a line like this:
18+
Then run `bundle install`. You're done!
19+
20+
## Rails 3.0
21+
22+
This gem adds a single generator to Rails 3, jquery:install. Running the generator will remove any Prototype JS files you may happen to have, fetch jQuery and the jQuery-ujs driver for Rails, and (optionally) fetch jQuery UI.
23+
24+
The gem will also hook into the Rails configuration process, removing Prototype and adding jQuery to the javascript files included by the `javascript_include_tag(:defaults)` call. While the plugin downloads minified and un-minified versions of jQuery and jQuery UI, only the minified versions are included in :default.
25+
26+
### Installation
27+
28+
In your Gemfile, add this line:
1729

1830
gem "jquery-rails"
1931

20-
Then run `bundle install`. You're done!
32+
Then, run `bundle install`. To invoke the generator, run:
33+
34+
rails generate jquery:install #--ui to enable jQuery UI --version to install specific version of JQuery (default is 1.6)
35+
36+
You're done!

0 commit comments

Comments
 (0)