Class: AriGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Includes:
Rails::Generators::Migration
Defined in:
lib/generators/ari_generator.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.source_rootObject



6
7
8
# File 'lib/generators/ari_generator.rb', line 6

def self.source_root
  @source_root ||= File.expand_path(File.join(File.dirname(__FILE__), 'templates/'))
end

Instance Method Details

#createObject



10
11
12
13
14
15
16
# File 'lib/generators/ari_generator.rb', line 10

def create
  template "views/index.html.erb", File.join('app/views', 'ari', "index.html.erb")
  template "views/show.html.erb", File.join('app/views', 'ari', "show.html.erb")
  template "views/_styles.html.erb", File.join('app/views', 'ari', "_styles.html.erb")
  template "views/_paging.html.erb", File.join('app/views', 'ari', "_paging.html.erb")
  template "controllers/ari_controller.rb", File.join('app/controllers', 'ari_controller.rb')
end