Class: ActiveFields::Generators::ScaffoldGenerator

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

Instance Method Summary collapse

Instance Method Details

#add_routesObject



20
21
22
# File 'lib/generators/active_fields/scaffold/scaffold_generator.rb', line 20

def add_routes
  route "resources :active_fields"
end

#copy_filesObject



12
13
14
15
16
17
18
# File 'lib/generators/active_fields/scaffold/scaffold_generator.rb', line 12

def copy_files
  Dir.glob("**/*", base: self.class.source_root).each do |path|
    next unless File.file?(File.expand_path(path, self.class.source_root))

    copy_file path, File.join("app", path)
  end
end