Class: Buttercms::Generators::InstallGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Defined in:
lib/generators/buttercms/install_generator.rb

Instance Method Summary collapse

Instance Method Details

#copy_initializerObject



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/generators/buttercms/install_generator.rb', line 7

def copy_initializer
  puts "Copying blog templates into app/views/blog/"
  copy_file "home.html.erb", "app/views/blog/home.html.erb"
  copy_file "post.html.erb", "app/views/blog/post.html.erb"
  copy_file "author.html.erb", "app/views/blog/author.html.erb"
  copy_file "category.html.erb", "app/views/blog/category.html.erb"
  copy_file "_pagers.html.erb", "app/views/blog/_pagers.html.erb"
  copy_file "_post.html.erb", "app/views/blog/_post.html.erb"
  puts "Success"

  puts "Installing ButterCMS API token and /blog route."
  copy_file "butter_initializer.rb", "config/initializers/butter.rb"
  route "mount Buttercms::Engine => '/blog'"
  puts "Success! View your blog at localhost:3000/blog"
end