Class: Haml::Generators::ScaffoldGenerator

Inherits:
Erb::Generators::ScaffoldGenerator
  • Object
show all
Extended by:
TemplatePath
Defined in:
lib/generators/haml/scaffold/scaffold_generator.rb

Instance Method Summary collapse

Methods included from TemplatePath

source_root

Instance Method Details

#copy_form_fileObject



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

def copy_form_file
  if options[:form_builder].nil?
    filename = filename_with_extensions("_form")
    template template_filename_with_extensions("_form"), File.join("app/views", controller_file_path, filename)
  end
end

#copy_view_filesObject



9
10
11
12
13
14
15
16
17
# File 'lib/generators/haml/scaffold/scaffold_generator.rb', line 9

def copy_view_files
  views = available_views
  views.delete("index") if options[:singleton]

  views.each do |view|
    filename = filename_with_extensions(view)
    template template_filename_with_extensions(view), File.join("app/views", controller_file_path, filename)
  end
end