diff --git a/README.md b/README.md index e67eb438..4d6c2e5d 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ In your Gemfile, add this line: Then, run `bundle install`. To invoke the generator, run: - rails generate jquery:install #--ui to enable jQuery UI --version to install specific version of JQuery (default is 1.4.2) + rails generate jquery:install #--ui to enable jQuery UI --version to install specific version of JQuery (default is 1.4.1) You're done! Don't forget to output `csrf_meta_tag` somewhere inside your `` tag in your layout! diff --git a/lib/generators/jquery/install/install_generator.rb b/lib/generators/jquery/install/install_generator.rb index 5f65e389..899fa2d8 100644 --- a/lib/generators/jquery/install/install_generator.rb +++ b/lib/generators/jquery/install/install_generator.rb @@ -4,7 +4,7 @@ class InstallGenerator < ::Rails::Generators::Base desc "This generator downloads and installs jQuery, jQuery-ujs HEAD, and (optionally) jQuery UI 1.8.4" class_option :ui, :type => :boolean, :default => false, :desc => "Whether to Include JQueryUI" class_option :version, :type => :string, :default => "1.4.1", :desc => "Which version of JQuery to fetch" - @@versions = %w( 1.4.2 1.4.1 1.4.0 1.3.2 1.3.1 1.3.0 1.2.6 ) + @@versions = %w( 1.4.3 1.4.2 1.4.1 1.4.0 1.3.2 1.3.1 1.3.0 1.2.6 ) def remove_prototype @@ -20,9 +20,9 @@ def download_jquery get "http://ajax.googleapis.com/ajax/libs/jquery/#{options.version}/jquery.min.js", "public/javascripts/jquery.min.js" get "http://ajax.googleapis.com/ajax/libs/jquery/#{options.version}/jquery.js", "public/javascripts/jquery.js" else - puts "JQuery #{options.version} is invalid; fetching #{@@versions[1]} instead." - get "http://ajax.googleapis.com/ajax/libs/jquery/#{@@versions[1]}/jquery.min.js", "public/javascripts/jquery.min.js" - get "http://ajax.googleapis.com/ajax/libs/jquery/#{@@versions[1]}/jquery.js", "public/javascripts/jquery.js" + puts "JQuery #{options.version} is invalid; fetching #{@@versions[2]} instead." + get "http://ajax.googleapis.com/ajax/libs/jquery/#{@@versions[2]}/jquery.min.js", "public/javascripts/jquery.min.js" + get "http://ajax.googleapis.com/ajax/libs/jquery/#{@@versions[2]}/jquery.js", "public/javascripts/jquery.js" end # Downloading latest jQueryUI minified