Class: SeoOptimizer::MetaTagsGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Defined in:
lib/generators/seo_optimizer/meta_tags/meta_tags_generator.rb

Instance Method Summary collapse

Instance Method Details

#add_meta_tagsObject



10
11
12
13
14
15
16
17
# File 'lib/generators/seo_optimizer/meta_tags/meta_tags_generator.rb', line 10

def add_meta_tags
  inject_into_file 'app/views/layouts/application.html.erb', after: '<head>' do
    File.open("#{File.expand_path('templates', __dir__)}/meta_tags.erb").read
  end
  template 'meta_tags_helper.erb', File.join('app/helpers', 'meta_tags_helper.rb')
  template 'default_meta.erb', File.join('config/initializers', 'default_meta.rb')
  template 'meta_yml.erb', File.join('config', 'meta.yml')
end