Class: Haml::Generators::ScaffoldGenerator

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

Instance Method Summary collapse

Instance Method Details

#copy_view_filesObject



14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/generators/haml/scaffold/scaffold_generator.rb', line 14

def copy_view_files
  available_views.each do |view|
    next if (view == '_form') && !options[:form_builder].nil?

    template_filename = find_template_for_rails_version view
    filename = filename_with_extensions view

    template template_filename, File.join('app/views', controller_file_path, filename)
  end

  if ::Rails::VERSION::MAJOR >= 7
    template find_template_for_rails_version('partial'), File.join('app/views', controller_file_path, "_#{singular_name}.html.haml")
  end
end