Class: NestedGenerator

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

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.source_rootObject



10
11
12
# File 'lib/generators/nested_generator.rb', line 10

def self.source_root
  File.join(File.dirname(__FILE__), 'templates')
end

Instance Method Details

#installObject



4
5
6
7
8
# File 'lib/generators/nested_generator.rb', line 4

def install
  # Copy the unobtrusive JS file
  copy_file('nested-fields.js', 'public/javascripts/nested-fields.js')
  copy_file('nested_fields_helper.rb', 'app/helpers/nested_fields_helper.rb')
end