Class: NestedForm::Generators::InstallGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Defined in:
lib/generators/nested_form/install_generator.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.source_rootObject



4
5
6
# File 'lib/generators/nested_form/install_generator.rb', line 4

def self.source_root
  File.expand_path('../../../../vendor/assets/javascripts', __FILE__)
end

Instance Method Details

#copy_jquery_fileObject



8
9
10
11
12
13
14
# File 'lib/generators/nested_form/install_generator.rb', line 8

def copy_jquery_file
  if File.exists?('public/javascripts/prototype.js')
    copy_file 'prototype_nested_form.js', 'public/javascripts/nested_form.js'
  else
    copy_file 'jquery_nested_form.js', 'public/javascripts/nested_form.js'
  end
end