Class: ActiveMail::Generators::ComponentGenerator

Inherits:
Rails::Generators::NamedBase
  • Object
show all
Defined in:
lib/generators/activemail/component_generator.rb

Instance Method Summary collapse

Instance Method Details

#create_componentObject



12
13
14
# File 'lib/generators/activemail/component_generator.rb', line 12

def create_component
  template 'component.rb.tt', File.join('app', 'mailers', 'components', "#{file_name}.rb")
end

#show_register_snippetObject



16
17
18
19
20
21
# File 'lib/generators/activemail/component_generator.rb', line 16

def show_register_snippet
  say "\nRegister the component in config/initializers/activemail.rb:", :green
  say %(  config.register_component "#{tag_name}", Components::#{class_name})
  say '(top-level Components:: — rename the module if it collides in your app)', :yellow
  say "\nThen use <#{tag_name}>…</#{tag_name}> in your ActiveMail views.\n"
end