Class: Haml::Generators::ScaffoldGenerator
- Inherits:
-
Base
- Object
- Rails::Generators::NamedBase
- Base
- Haml::Generators::ScaffoldGenerator
- Includes:
- Rails::Generators::ResourceHelpers
- Defined in:
- lib/rails/generators/haml/scaffold/scaffold_generator.rb
Instance Method Summary collapse
- #copy_destroy_file ⇒ Object
- #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_destroy_file ⇒ Object
24 25 26 |
# File 'lib/rails/generators/haml/scaffold/scaffold_generator.rb', line 24 def copy_destroy_file copy_coffee :destroy end |
#copy_edit_file ⇒ Object
28 29 30 |
# File 'lib/rails/generators/haml/scaffold/scaffold_generator.rb', line 28 def copy_edit_file copy_view :edit end |
#copy_form_file ⇒ Object
40 41 42 |
# File 'lib/rails/generators/haml/scaffold/scaffold_generator.rb', line 40 def copy_form_file copy_view :_form end |
#copy_index_file ⇒ Object
19 20 21 22 |
# File 'lib/rails/generators/haml/scaffold/scaffold_generator.rb', line 19 def copy_index_file return if [:singleton] copy_view :index end |
#copy_layout_file ⇒ Object
44 45 46 47 |
# File 'lib/rails/generators/haml/scaffold/scaffold_generator.rb', line 44 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
36 37 38 |
# File 'lib/rails/generators/haml/scaffold/scaffold_generator.rb', line 36 def copy_new_file copy_view :new end |
#copy_show_file ⇒ Object
32 33 34 |
# File 'lib/rails/generators/haml/scaffold/scaffold_generator.rb', line 32 def copy_show_file copy_view :show end |
#create_root_folder ⇒ Object
15 16 17 |
# File 'lib/rails/generators/haml/scaffold/scaffold_generator.rb', line 15 def create_root_folder empty_directory File.join("app/views", controller_file_path) end |