Class: SimpleFormHaml::Generators::ScaffoldGenerator
- Inherits:
-
Erb::Generators::ScaffoldGenerator
- Object
- Erb::Generators::ScaffoldGenerator
- SimpleFormHaml::Generators::ScaffoldGenerator
- Extended by:
- TemplatePath
- Defined in:
- lib/generators/simple_form_haml/scaffold/scaffold_generator.rb
Instance Method Summary collapse
Methods included from TemplatePath
Instance Method Details
#copy_layout_file ⇒ Object
9 10 11 12 13 |
# File 'lib/generators/simple_form_haml/scaffold/scaffold_generator.rb', line 9 def copy_layout_file return unless [:layout] template "layout.haml.erb", File.join("app/views/layouts", controller_class_path, "#{controller_file_name}.html.haml") end |
#copy_shared_files ⇒ Object
15 16 17 18 |
# File 'lib/generators/simple_form_haml/scaffold/scaffold_generator.rb', line 15 def copy_shared_files template "_form_errors.haml.erb", File.join("app/views/shared", "_form_errors.html.haml") end |
#copy_view_files ⇒ Object
20 21 22 23 24 25 26 27 |
# File 'lib/generators/simple_form_haml/scaffold/scaffold_generator.rb', line 20 def copy_view_files views = available_views views.delete("index") if [:singleton] views.each do |view| template "#{view}.haml.erb", File.join("app/views", controller_file_path, "#{view}.html.haml") end end |