Class: Ember::Generators::ControllerGenerator

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

Instance Method Summary collapse

Methods included from GeneratorHelpers

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

Instance Method Details

#create_controller_filesObject


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

def create_controller_files
  file_path = File.join(app_path, 'controllers', class_path, "#{file_name}.es6")

  if options.array?
    template "array_controller.es6", file_path
  elsif options.object?
    template "object_controller.es6", file_path
  else
    template "controller.es6", file_path
  end
end