Class: Ingoweiss::ScaffoldControllerGenerator

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

Class Method Summary collapse

Instance Method Summary collapse

Methods included from ScopeHelpers

#instance_variable_scope, #scope, #scope_prefix, #scoped?, #singleton?, #unscoped?

Class Method Details

.source_rootObject



11
12
13
# File 'lib/generators/ingoweiss/scaffold_controller/scaffold_controller_generator.rb', line 11

def self.source_root
  @source_root ||= File.expand_path('../templates', __FILE__)
end

Instance Method Details

#generate_controllerObject



15
16
17
# File 'lib/generators/ingoweiss/scaffold_controller/scaffold_controller_generator.rb', line 15

def generate_controller
  template 'controller.erb', "app/controllers/#{scoped_controller_plural_name}_controller.rb"
end

#generate_viewsObject



19
20
21
# File 'lib/generators/ingoweiss/scaffold_controller/scaffold_controller_generator.rb', line 19

def generate_views
  invoke 'ingoweiss:scaffold_views'
end