Class: ComponentsGenerator

Inherits:
Rails::Generators::NamedBase
  • Object
show all
Defined in:
lib/generators/components/components_generator.rb

Instance Method Summary collapse

Instance Method Details

#add_componentObject



4
5
6
7
8
9
10
11
# File 'lib/generators/components/components_generator.rb', line 4

def add_component
  @family = name.underscore.pluralize # Force plural
  @family_cst = @family.camelize.pluralize # Force plural

  %w[Destroy Edit Form New].each do |comp_cst|
    generate "component #{name}::#{comp_cst}"
  end
end