Class: Koi::AdminControllerGenerator

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

Instance Method Summary collapse

Instance Method Details

#create_controller_filesObject



16
17
18
19
20
21
# File 'lib/generators/koi/admin_controller/admin_controller_generator.rb', line 16

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

#create_spec_filesObject



23
24
25
26
27
28
# File 'lib/generators/koi/admin_controller/admin_controller_generator.rb', line 23

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