Class: Rails::Generators::ActiveScaffoldControllerGenerator

Inherits:
NamedBase
  • Object
show all
Includes:
ResourceHelpers
Defined in:
lib/generators/active_scaffold_controller/active_scaffold_controller_generator.rb

Overview

metagenerator

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.source_rootObject



8
9
10
# File 'lib/generators/active_scaffold_controller/active_scaffold_controller_generator.rb', line 8

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

Instance Method Details

#create_controller_filesObject



17
18
19
20
# File 'lib/generators/active_scaffold_controller/active_scaffold_controller_generator.rb', line 17

def create_controller_files
  template 'controller.rb', File.join('app/controllers', class_path, "#{controller_file_name}_controller.rb")
  template 'helper.rb', File.join('app/helpers', class_path, "#{controller_file_name}_helper.rb")
end

#create_view_root_folderObject



24
25
26
# File 'lib/generators/active_scaffold_controller/active_scaffold_controller_generator.rb', line 24

def create_view_root_folder
  empty_directory File.join("app/views", controller_file_path)
end