Class: FavouriteObject::TemplateGenerator

Inherits:
Rails::Generators::NamedBase
  • Object
show all
Defined in:
lib/generators/favourite_object/template/template_generator.rb

Instance Method Summary collapse

Instance Method Details

#generate_templatesObject



6
7
8
9
10
11
12
13
14
# File 'lib/generators/favourite_object/template/template_generator.rb', line 6

def generate_templates
  # generate template files for name
  template "message.html.erb.erb", "app/views/favourite_object/#{name.underscore}/message.html.erb"

  addition_classes.each do |class_name|
    #iterates through each additional class and generates template files
    template "message.html.erb.erb", "app/views/favourite_object/#{class_name.underscore}/message.html.erb"
  end 
end