Class: Swage::Generators::ScaffoldGenerator
- Inherits:
-
BaseGenerator
- Object
- Rails::Generators::NamedBase
- BaseGenerator
- Swage::Generators::ScaffoldGenerator
- Defined in:
- lib/generators/swage/scaffold/scaffold_generator.rb
Instance Method Summary collapse
- #create_controller_files ⇒ Object
-
#create_view_files ⇒ Object
add json templates as necessary.
Methods inherited from BaseGenerator
Instance Method Details
#create_controller_files ⇒ Object
23 24 25 |
# File 'lib/generators/swage/scaffold/scaffold_generator.rb', line 23 def create_controller_files template "controller.rb.tt", File.join("app/controllers", "#{controller_file_path}_controller.rb") end |
#create_view_files ⇒ Object
add json templates as necessary
15 16 17 18 19 20 21 |
# File 'lib/generators/swage/scaffold/scaffold_generator.rb', line 15 def create_view_files actions = %w[index show new edit form partial] actions.each do |action| template "#{action}.rb.tt", File.join("app/views", controller_file_path, "#{action}.rb") end end |