Class: Koi::AdminControllerGenerator

Inherits:
Rails::Generators::NamedBase
  • Object
show all
Includes:
Helpers::AdminGeneratorAttributes, Rails::Generators::ResourceHelpers
Defined in:
lib/generators/koi/admin_controller/admin_controller_generator.rb

Instance Method Summary collapse

Methods included from Helpers::AdminGeneratorAttributes

#collection_attribute_for, #govuk_input_for, #index_attribute_for, #index_attributes

Instance Method Details

#create_controller_filesObject



19
20
21
22
23
24
# File 'lib/generators/koi/admin_controller/admin_controller_generator.rb', line 19

def create_controller_files
  template("controller.rb",
           File.join("app/controllers",
                     controller_class_path,
                     "#{controller_file_name}_controller.rb"))
end

#create_spec_filesObject



26
27
28
29
30
31
# File 'lib/generators/koi/admin_controller/admin_controller_generator.rb', line 26

def create_spec_files
  template("controller_spec.rb",
           File.join("spec/requests",
                     controller_class_path,
                     "#{controller_file_name}_controller_spec.rb"))
end