Class: Puffer::ControllerGenerator
- Inherits:
-
Rails::Generators::NamedBase
- Object
- Rails::Generators::NamedBase
- Puffer::ControllerGenerator
- Defined in:
- lib/generators/puffer/controller/controller_generator.rb
Instance Method Summary collapse
Instance Method Details
#generate_controller ⇒ Object
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 |