Class: Para::Component::CrudGenerator

Inherits:
Rails::Generators::NamedBase
  • Object
show all
Includes:
Generators::ComponentHelpers
Defined in:
lib/generators/para/component/crud/crud_generator.rb

Instance Method Summary collapse

Instance Method Details

#add_routeObject



26
27
28
# File 'lib/generators/para/component/crud/crud_generator.rb', line 26

def add_route
  add_component_to_routes :crud_component, file_name
end

#copy_crud_componentObject



14
15
16
# File 'lib/generators/para/component/crud/crud_generator.rb', line 14

def copy_crud_component
  template 'component.rb', "app/components/#{ component_file_name }.rb"
end

#copy_crud_component_decoratorObject



18
19
20
# File 'lib/generators/para/component/crud/crud_generator.rb', line 18

def copy_crud_component_decorator
  template 'decorator.rb', "app/decorators/#{ decorator_file_name }.rb"
end

#copy_crud_resources_controllerObject



22
23
24
# File 'lib/generators/para/component/crud/crud_generator.rb', line 22

def copy_crud_resources_controller
  template 'resources_controller.rb', "app/controllers/admin/#{ resources_controller_name }.rb"
end

#welcomeObject



10
11
12
# File 'lib/generators/para/component/crud/crud_generator.rb', line 10

def welcome
  say 'Creating CRUD component...'
end