class AdminHelp::InstallGenerator < ::Rails::Generators::Base include Rails::Generators::Migration source_root File.expand_path('../templates', __FILE__) desc 'Copy templates for admin scaffold controller.' def install copy_file File.expand_path('../templates/app/views/layouts/admin_help.html.erb', __FILE__), 'app/views/layouts/admin_help.html.erb' copy_file File.expand_path('../templates/app/views/layouts/flash.html.erb', __FILE__), 'app/views/layouts/flash.html.erb' copy_file File.expand_path('../templates/app/views/layouts/header.html.erb', __FILE__), 'app/views/layouts/header.html.erb' copy_file File.expand_path('../templates/app/views/layouts/left_nav.html.erb', __FILE__), 'app/views/layouts/left_nav.html.erb' copy_file File.expand_path('../templates/app/controllers/admin/home_controller.rb', __FILE__), 'app/controllers/admin/home_controller.rb' copy_file File.expand_path('../templates/app/views/admin/home/index.html.erb', __FILE__), 'app/views/admin/home/index.html.erb' copy_file File.expand_path('../templates/config/routes.rb', __FILE__), 'config/routes.rb' copy_file File.expand_path('../templates/config/initializers/locale.rb', __FILE__), 'config/initializers/locale.rb' copy_file File.expand_path('../templates/config/locales/models/en.models.yml', __FILE__), 'config/locales/models/en.models.yml' copy_file File.expand_path('../templates/config/locales/models/zh-cn.models.yml', __FILE__), 'config/locales/models/zh-cn.models.yml' copy_file File.expand_path('../templates/config/locales/views/en.common.yml', __FILE__), 'config/locales/views/en.common.yml' copy_file File.expand_path('../templates/config/locales/views/zh-cn.common.yml', __FILE__), 'config/locales/views/zh-cn.common.yml' end end