Class: Para::Component::CrudGenerator
- Inherits:
-
Rails::Generators::NamedBase
- Object
- Rails::Generators::NamedBase
- Para::Component::CrudGenerator
- Includes:
- Generators::ComponentHelpers
- Defined in:
- lib/generators/para/component/crud/crud_generator.rb
Instance Method Summary collapse
- #add_route ⇒ Object
- #copy_crud_component ⇒ Object
- #copy_crud_component_decorator ⇒ Object
- #copy_crud_resources_controller ⇒ Object
- #welcome ⇒ Object
Instance Method Details
#add_route ⇒ Object
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_component ⇒ Object
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_decorator ⇒ Object
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_controller ⇒ Object
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 |
#welcome ⇒ Object
10 11 12 |
# File 'lib/generators/para/component/crud/crud_generator.rb', line 10 def welcome say 'Creating CRUD component...' end |