Class: AnchormodelGenerator
- Inherits:
-
Rails::Generators::NamedBase
- Object
- Rails::Generators::NamedBase
- AnchormodelGenerator
- Defined in:
- lib/generators/anchormodel/anchormodel_generator.rb
Overview
Rails generator for scaffolding a new anchormodel.
Instance Method Summary collapse
-
#add_anchormodel ⇒ void
Writes the new anchormodel file from the ERB template.
Instance Method Details
#add_anchormodel ⇒ void
This method returns an undefined value.
Writes the new anchormodel file from the ERB template.
12 13 14 15 16 17 18 |
# File 'lib/generators/anchormodel/anchormodel_generator.rb', line 12 def add_anchormodel fail('NAME must be present.') if name.blank? @klass = @name.camelize @filename = @name.underscore template 'anchormodel.rb.erb', "app/anchormodels/#{@filename}.rb" end |