Class: Ember::Generators::ComponentGenerator

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

Instance Method Summary collapse

Methods included from GeneratorHelpers

#application_name, #class_name, #configuration, #ember_path, #engine_extension, #engine_name, #handlebars_template_path, #rails_engine?

Instance Method Details

#create_component_filesObject



16
17
18
19
20
21
22
23
24
# File 'lib/generators/ember/component_generator.rb', line 16

def create_component_files
  dashed_file_name = file_name.gsub(/_/, '-')
  comp_path = File.join(ember_path, 'components', class_path, "#{dashed_file_name}_component.#{engine_extension}")
  template "component.#{engine_extension}", comp_path

  templ_path = File.join(ember_path, 'templates/components', class_path, "#{dashed_file_name}.hbs")
  template "component.template.hbs", templ_path

end