Class: Rails::Generators::ResourceTemplateGenerator

Inherits:
Erb::Generators::Base
  • Object
show all
Defined in:
lib/rails/generators/resource_template_generator.rb

Instance Method Summary collapse

Instance Method Details

#create_resource_template_filesObject



8
9
10
11
12
13
14
15
16
17
# File 'lib/rails/generators/resource_template_generator.rb', line 8

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

  [:index, :show].each do |action|
    @action = action
    @path = File.join(base_path, filename_with_extensions(action))
    template filename_with_extensions(action), @path
  end
end