Class: Haml::Generators::ScaffoldGenerator

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

Instance Method Summary collapse

Instance Method Details

#copy_form_fileObject



26
27
28
29
30
31
# File 'lib/generators/hierapolis/templates/generators/haml/scaffold/scaffold_generator.rb', line 26

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
14
15
16
17
18
19
20
21
22
# File 'lib/generators/hierapolis/templates/generators/haml/scaffold/scaffold_generator.rb', line 8

def copy_view_files
  available_views.each do |view|
    filename = filename_with_extensions(view)
    if filename == "_#{singular_table_name}.html.haml"
      #create_file File.join("app/views", controller_file_path, "_#{singular_table_name}.html.haml") do
      #  hostname = ask("What is the virtual hostname I should use?")
      #  "vhost.name = #{hostname}"
      #end

      template 'single_entry.html.haml', File.join("app/views", controller_file_path, filename)
    else
      template "#{view}.html.haml", File.join("app/views", controller_file_path, filename)
    end
  end
end