Class: Haml::Generators::ScaffoldGenerator
- Inherits:
-
Base
- Object
- Rails::Generators::NamedBase
- Base
- Haml::Generators::ScaffoldGenerator
- Includes:
- Rails::Generators::ResourceHelpers
- Defined in:
- lib/generators/haml_rails/templates/scaffold/scaffold_generator.rb
Instance Method Summary collapse
- #copy_edit_file ⇒ Object
- #copy_form_file ⇒ Object
- #copy_index_file ⇒ Object
- #copy_layout_file ⇒ Object
- #copy_new_file ⇒ Object
- #copy_show_file ⇒ Object
- #create_root_folder ⇒ Object
Methods inherited from Base
Instance Method Details
#copy_edit_file ⇒ Object
23 24 25 |
# File 'lib/generators/haml_rails/templates/scaffold/scaffold_generator.rb', line 23 def copy_edit_file copy_view :edit end |
#copy_form_file ⇒ Object
35 36 37 |
# File 'lib/generators/haml_rails/templates/scaffold/scaffold_generator.rb', line 35 def copy_form_file copy_view :_form end |
#copy_index_file ⇒ Object
18 19 20 21 |
# File 'lib/generators/haml_rails/templates/scaffold/scaffold_generator.rb', line 18 def copy_index_file return if [:singleton] copy_view :index end |
#copy_layout_file ⇒ Object
39 40 41 42 |
# File 'lib/generators/haml_rails/templates/scaffold/scaffold_generator.rb', line 39 def copy_layout_file return unless [:layout] template "layout.html.haml", File.join("app/views/layouts", controller_class_path, "#{controller_file_name}.html.haml") end |
#copy_new_file ⇒ Object
31 32 33 |
# File 'lib/generators/haml_rails/templates/scaffold/scaffold_generator.rb', line 31 def copy_new_file copy_view :new end |
#copy_show_file ⇒ Object
27 28 29 |
# File 'lib/generators/haml_rails/templates/scaffold/scaffold_generator.rb', line 27 def copy_show_file copy_view :show end |
#create_root_folder ⇒ Object
14 15 16 |
# File 'lib/generators/haml_rails/templates/scaffold/scaffold_generator.rb', line 14 def create_root_folder empty_directory File.join("app/views", controller_file_path) end |