README.md in jquery-rails-cdn-0.3.0 vs README.md in jquery-rails-cdn-0.4.0

- old
+ new

@@ -41,32 +41,32 @@ 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`, `:cloudflare` 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> <script type="text/javascript"> //<![CDATA[ window.jQuery || document.write(unescape('%3Cscript src="/assets/jquery-3aaa3fa0b0207a1abcd30555987cd4cc.js" type="text/javascript">%3C/script>')) @@ -76,15 +76,9 @@ on development: ```html <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