Class: Jquery::Generators::InstallGenerator

### Home Classes Methods

### In Files

- lib/generators/jquery/install/install_generator.rb

### Parent

Rails::Generators::Base

### Methods

- #copy_jquery
- #copy_ujs_driver
- #do_nothing
- #remove_prototype

### Class/Module Index

Quicksearch

- Jquery
- Jquery::Generators
- Jquery::Generators::InstallGenerator
- Jquery::Rails
- Jquery::Rails::Engine
- Jquery::Rails::Railtie
- ActionDispatch
- ActionDispatch::Assertions
- ActionDispatch::Assertions::SelectorAssertions

No matching classes.

# Jquery::Generators::InstallGenerator

### Public Instance Methods

copy_jquery() click to toggle source

    # File lib/generators/jquery/install/install_generator.rb, line 18
    def copy_jquery
      say_status("copying", "jQuery (#{Jquery::Rails::JQUERY_VERSION})", :green)
      copy_file "jquery.js", "public/javascripts/jquery.js"
      copy_file "jquery.min.js", "public/javascripts/jquery.min.js"
    end

copy_ujs_driver() click to toggle source

    # File lib/generators/jquery/install/install_generator.rb, line 24
    def copy_ujs_driver
      say_status("copying", "jQuery UJS adapter (#{Jquery::Rails::JQUERY_UJS_VERSION[0..5]})", :green)
      remove_file "public/javascripts/rails.js"
      copy_file "jquery_ujs.js", "public/javascripts/jquery_ujs.js"
    end

do_nothing() click to toggle source

    # File lib/generators/jquery/install/install_generator.rb, line 39
    def do_nothing
      say_status("deprecated", "You are using Rails 3.1 with the asset pipeline enabled, so this generator is not needed.")
      say_status("", "The necessary files are already in your asset pipeline.")
      say_status("", "Just add `//= require jquery` and `//= require jquery_ujs` to your app/assets/javascripts/application.js")
      say_status("", "If you upgraded your app from Rails 3.0 and still have jquery.js, rails.js, or jquery_ujs.js in your javascripts, be sure to remove them.")
      say_status("", "If you do not want the asset pipeline enabled, you may turn it off in application.rb and re-run this generator.")
      # ok, nothing
    end

remove_prototype() click to toggle source

    # File lib/generators/jquery/install/install_generator.rb, line 12
    def remove_prototype
      Rails::PROTOTYPE_JS.each do |name|
        remove_file "public/javascripts/#{name}.js"
      end
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.