Class: Haml::Generators::ScaffoldGenerator

Inherits:
Base
  • Object
show all
Includes:
Rails::Generators::ResourceHelpers
Defined in:
lib/generators/haml_rails/templates/scaffold/scaffold_generator.rb

Instance Method Summary collapse

Methods inherited from Base

source_root

Instance Method Details

#copy_edit_fileObject



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_fileObject



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_fileObject



18
19
20
21
# File 'lib/generators/haml_rails/templates/scaffold/scaffold_generator.rb', line 18

def copy_index_file
  return if options[:singleton]
  copy_view :index
end

#copy_layout_fileObject



39
40
41
42
# File 'lib/generators/haml_rails/templates/scaffold/scaffold_generator.rb', line 39

def copy_layout_file
  return unless options[:layout]
  template "layout.html.haml", File.join("app/views/layouts", controller_class_path, "#{controller_file_name}.html.haml")
end

#copy_new_fileObject



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_fileObject



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_folderObject



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