Class: Ember::Generators::ScaffoldGenerator

Inherits:
ModelGenerator
  • Object
show all
Defined in:
lib/generators/ember/scaffold_generator.rb

Instance Method Summary collapse

Methods inherited from ModelGenerator

#create_model_files

Methods included from GeneratorHelpers

#app_path, #application_name, #class_name, #config_path, #configuration, #engine_name, #handlebars_template_path, #javascript_assets_path, #rails_engine?

Instance Method Details

#create_route_filesObject



13
14
15
16
# File 'lib/generators/ember/scaffold_generator.rb', line 13

def create_route_files
  create_resource_files_for(:route, 'js.es6')
  inject_into_router_file(file_name)
end

#create_template_filesObject



18
19
20
21
22
# File 'lib/generators/ember/scaffold_generator.rb', line 18

def create_template_files
  create_resource_files_for(:template, 'hbs')
  template "scaffold/template.hbs", File.join(app_path, 'templates', "#{file_name.pluralize}.hbs")
  template "scaffold/template/form.hbs", File.join(app_path, 'templates', file_name.pluralize, 'form.hbs')
end