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_form_fileObject



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

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

#copy_view_filesObject



8
9
10
11
12
13
# File 'lib/generators/haml/scaffold/scaffold_generator.rb', line 8

def copy_view_files
  available_views.each do |view|
    filename = filename_with_extensions(view)
    template "#{view}.html.haml", File.join("app/views", controller_file_path, filename)
  end
end