Class: Puffer::ControllerGenerator

Inherits:
Rails::Generators::NamedBase
  • Object
show all
Defined in:
lib/generators/puffer/controller/controller_generator.rb

Instance Method Summary collapse

Instance Method Details

#generate_controllerObject



4
5
6
7
8
9
# File 'lib/generators/puffer/controller/controller_generator.rb', line 4

def generate_controller
  @modules = name.camelize.split('::')
  @model_name = @modules.delete_at(-1)

  template 'controller.rb', "app/controllers/#{controller_name.underscore}_controller.rb"
end