Class: WebAppTheme::Generators::ControllerGenerator

Inherits:
Base
  • Object
show all
Defined in:
lib/generators/web_app_theme/controller/controller_generator.rb

Instance Method Summary collapse

Methods inherited from Base

haml?, source_root

Instance Method Details

#create_view_filesObject



8
9
10
11
12
13
14
15
16
17
18
# File 'lib/generators/web_app_theme/controller/controller_generator.rb', line 8

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.#{extension}")
    
    template "view.html.#{extension}", @path
  end
end