Permalink
Browse files

Updating README.

  • Loading branch information...
kenn committed Dec 4, 2012
1 parent 0b34c49 commit 17a0da138eda941f54a0206e1dd286f9262165f1
Showing with 11 additions and 17 deletions.
  1. +11 −17 README.md
View
@@ -43,27 +43,27 @@ gem 'jquery-rails-cdn'
## Usage
-This gem adds two methods `jquery_include_tag` to generate a script tag to the jQuery on a CDN of your preference.
+This gem adds two methods `jquery_include_tag` and `jquery_url`.
-If you're using asset pipeline with Rails 3.1+, first remove `//= require jquery` from `application.js`.
+If you're using asset pipeline with Rails 3.1+,
-Then in layout:
+- Remove `//= require jquery` from `application.js`.
+- Put the following line in `config/application.rb`, so that jquery.js will be served from your server when CDN is not available.
```ruby
-= jquery_include_tag :google
-= javascript_include_tag 'application'
+config.assets.precompile += ['jquery.js']
```
-Note that valid CDN symbols are:
+Then in layout:
```ruby
-:google
-:microsoft
-:jquery
-:yandex
+= jquery_include_tag :google
+= javascript_include_tag 'application'
```
-It will generate the following on production:
+Note that valid CDN symbols are `:google`, `:microsoft`, `:jquery` and `:yandex`.
+
+Now, it will generate the following on production:
```html
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js" type="text/javascript"></script>
@@ -80,12 +80,6 @@ on development:
<script src="/assets/jquery.js?body=1" type="text/javascript"></script>
```
-Be sure to put the following line in `config/application.rb`, as it will be served when CDN is not available.
-
-```ruby
-config.assets.precompile += ['jquery.js']
-```
-
If you want to check the production URL, you can pass `:force => true` as an option.
```ruby

0 comments on commit 17a0da1

Please sign in to comment.