Class: Ember::ModelGenerator

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

Instance Method Summary collapse

Methods included from GeneratorHelpers

#application_name, #ember_path, #spec_path

Instance Method Details

#generate_directoryObject



9
10
11
# File 'lib/generators/ember/model/model_generator.rb', line 9

def generate_directory
  empty_directory "#{ember_path}/models"
end

#generate_modelObject



13
14
15
# File 'lib/generators/ember/model/model_generator.rb', line 13

def generate_model
  template 'model.js.coffee.erb', "#{ember_path}/models/#{model_name}.js.coffee.erb"
end

#generate_specsObject



17
18
19
# File 'lib/generators/ember/model/model_generator.rb', line 17

def generate_specs
  template 'model_spec.js.coffee', "spec/javascripts/models/#{model_name}_spec.js.coffee"
end