Class: ScaffoldController::Generators::ScaffoldControllerGenerator

Inherits:
Rails::Generators::NamedBase
  • Object
show all
Includes:
Rails::Generators::ResourceHelpers
Defined in:
lib/generators/scaffold_controller/scaffold_controller_generator.rb

Instance Method Summary collapse

Instance Method Details

#create_controller_filesObject



21
22
23
24
25
26
27
# File 'lib/generators/scaffold_controller/scaffold_controller_generator.rb', line 21

def create_controller_files
  if options[:singleton]
    template 'singleton_controller.rb', File.join('app/controllers', class_path, "#{controller_file_name}_controller.rb")
  else
    template 'controller.rb', File.join('app/controllers', class_path, "#{controller_file_name}_controller.rb")
  end
end