Class: Haml::Generators::ScaffoldGenerator

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

Instance Method Summary collapse

Methods inherited from Base

source_root

Instance Method Details

#copy_destroy_fileObject



24
25
26
# File 'lib/rails/generators/haml/scaffold/scaffold_generator.rb', line 24

def copy_destroy_file
  copy_coffee :destroy
end

#copy_edit_fileObject



28
29
30
# File 'lib/rails/generators/haml/scaffold/scaffold_generator.rb', line 28

def copy_edit_file
  copy_view :edit
end

#copy_form_fileObject



40
41
42
# File 'lib/rails/generators/haml/scaffold/scaffold_generator.rb', line 40

def copy_form_file
  copy_view :_form
end

#copy_index_fileObject



19
20
21
22
# File 'lib/rails/generators/haml/scaffold/scaffold_generator.rb', line 19

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

#copy_layout_fileObject



44
45
46
47
# File 'lib/rails/generators/haml/scaffold/scaffold_generator.rb', line 44

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



36
37
38
# File 'lib/rails/generators/haml/scaffold/scaffold_generator.rb', line 36

def copy_new_file
  copy_view :new
end

#copy_show_fileObject



32
33
34
# File 'lib/rails/generators/haml/scaffold/scaffold_generator.rb', line 32

def copy_show_file
  copy_view :show
end

#create_root_folderObject



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