Class: Symphonia::Generators::EntityController
- Inherits:
-
Rails::Generators::NamedBase
- Object
- Rails::Generators::NamedBase
- Symphonia::Generators::EntityController
- Includes:
- Rails::Generators::ResourceHelpers
- Defined in:
- lib/generators/symphonia/entity_controller/entity_controller_generator.rb
Instance Method Summary collapse
- #create_controller_files ⇒ Object
-
#edit_helper ⇒ Object
:doc:.
- #namespace ⇒ Object
-
#new_helper ⇒ Object
:doc:.
-
#show_helper ⇒ Object
:doc:.
Instance Method Details
#create_controller_files ⇒ Object
21 22 23 24 |
# File 'lib/generators/symphonia/entity_controller/entity_controller_generator.rb', line 21 def create_controller_files template_file = .api? ? "api_controller.rb" : "controller.rb" template template_file, File.join("app/controllers", controller_class_path, "#{controller_file_name}_controller.rb") end |
#edit_helper ⇒ Object
:doc:
38 39 40 |
# File 'lib/generators/symphonia/entity_controller/entity_controller_generator.rb', line 38 def edit_helper # :doc: "edit_#{show_helper}" end |
#namespace ⇒ Object
30 31 32 |
# File 'lib/generators/symphonia/entity_controller/entity_controller_generator.rb', line 30 def namespace ['namespace'] && ['namespace'].safe_constantize || super end |
#new_helper ⇒ Object
:doc:
42 43 44 |
# File 'lib/generators/symphonia/entity_controller/entity_controller_generator.rb', line 42 def new_helper # :doc: "new_#{singular_table_name}_path" end |
#show_helper ⇒ Object
:doc:
34 35 36 |
# File 'lib/generators/symphonia/entity_controller/entity_controller_generator.rb', line 34 def show_helper # :doc: "#{singular_table_name}_path(@#{singular_table_name})" end |