Class: Effective::Generators::ScaffoldControllerGenerator
- Inherits:
-
Rails::Generators::NamedBase
- Object
- Rails::Generators::NamedBase
- Effective::Generators::ScaffoldControllerGenerator
- Includes:
- Helpers
- Defined in:
- lib/generators/effective/scaffold_controller_generator.rb
Instance Method Summary collapse
- #invoke_ability ⇒ Object
- #invoke_controller ⇒ Object
- #invoke_datatable ⇒ Object
- #invoke_form ⇒ Object
- #invoke_menu ⇒ Object
- #invoke_route ⇒ Object
- #invoke_views ⇒ Object
Instance Method Details
#invoke_ability ⇒ Object
29 30 31 |
# File 'lib/generators/effective/scaffold_controller_generator.rb', line 29 def invoke_ability Rails::Generators.invoke('effective:ability', [name] + invoked_actions) end |
#invoke_controller ⇒ Object
21 22 23 |
# File 'lib/generators/effective/scaffold_controller_generator.rb', line 21 def invoke_controller Rails::Generators.invoke('effective:controller', [name] + invoked_actions + invoked_attributes_args) end |
#invoke_datatable ⇒ Object
37 38 39 40 41 42 43 |
# File 'lib/generators/effective/scaffold_controller_generator.rb', line 37 def invoke_datatable unless invoked_actions.include?('index') say_status(:skipped, :datatable, :yellow) and return end Rails::Generators.invoke('effective:datatable', [name] + invoked_actions + invoked_attributes_args) end |
#invoke_form ⇒ Object
49 50 51 52 53 54 55 |
# File 'lib/generators/effective/scaffold_controller_generator.rb', line 49 def invoke_form unless invoked_actions.include?('new') || invoked_actions.include?('edit') say_status(:skipped, :form, :yellow) and return end Rails::Generators.invoke('effective:form', [name] + invoked_attributes_args) end |
#invoke_menu ⇒ Object
33 34 35 |
# File 'lib/generators/effective/scaffold_controller_generator.rb', line 33 def Rails::Generators.invoke('effective:menu', [name]) end |
#invoke_route ⇒ Object
25 26 27 |
# File 'lib/generators/effective/scaffold_controller_generator.rb', line 25 def invoke_route Rails::Generators.invoke('effective:route', [name] + invoked_actions) end |
#invoke_views ⇒ Object
45 46 47 |
# File 'lib/generators/effective/scaffold_controller_generator.rb', line 45 def invoke_views Rails::Generators.invoke('effective:views', [name] + invoked_actions + invoked_attributes_args) end |