Class: AwsRecord::Generators::ScaffoldControllerGenerator
- Inherits:
-
Base
- Object
- Rails::Generators::NamedBase
- Base
- AwsRecord::Generators::ScaffoldControllerGenerator
- Includes:
- Rails::Generators::ResourceHelpers
- Defined in:
- lib/generators/aws_record/scaffold_controller/scaffold_controller_generator.rb
Instance Attribute Summary
Attributes inherited from Base
#gsi_rw_units, #gsis, #length_validations, #primary_read_units, #primary_write_units, #required_attrs
Instance Method Summary collapse
- #create_controller_files ⇒ Object
-
#initialize(args, *options) ⇒ ScaffoldControllerGenerator
constructor
A new instance of ScaffoldControllerGenerator.
Constructor Details
#initialize(args, *options) ⇒ ScaffoldControllerGenerator
Returns a new instance of ScaffoldControllerGenerator.
22 23 24 25 |
# File 'lib/generators/aws_record/scaffold_controller/scaffold_controller_generator.rb', line 22 def initialize(args, *) [0] << '--skip-table-config' super end |
Instance Method Details
#create_controller_files ⇒ Object
27 28 29 30 31 |
# File 'lib/generators/aws_record/scaffold_controller/scaffold_controller_generator.rb', line 27 def create_controller_files template_file = .api? ? 'api_controller.rb' : 'controller.rb' template template_file, File.join('app/controllers', controller_class_path, "#{controller_file_name}_controller.rb") end |