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

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

Instance Method Details

#create_controller_filesObject



22
23
24
25
26
27
28
29
30
31
32
# File 'lib/generators/ember/controller_generator.rb', line 22

def create_controller_files
  file_path = File.join(ember_path, 'controllers', class_path, "#{file_name.dasherize}.#{engine_extension}")

  if options.array?
    template "array_controller.#{engine_extension}", file_path
  elsif options.object?
    template "object_controller.#{engine_extension}", file_path
  else
    template "controller.#{engine_extension}", file_path
  end
end