Class: Haml::Generators::ControllerGenerator

Inherits:
Rails::Generators::NamedBase
  • Object
show all
Extended by:
TemplatePath
Defined in:
lib/generators/haml/controller/controller_generator.rb

Instance Method Summary collapse

Methods included from TemplatePath

source_root

Instance Method Details

#create_view_filesObject



11
12
13
14
15
16
17
18
19
20
21
# File 'lib/generators/haml/controller/controller_generator.rb', line 11

def create_view_files
  base_path = File.join("app/views", class_path, file_name)
  empty_directory base_path

  actions.each do |action|
    @action = action
    @path   = File.join(base_path, "#{action}.html.haml")

    template 'view.html.haml', @path
  end
end