Class: Jax::Generators::Model::ModelGenerator
Class Method Summary
collapse
Instance Method Summary
collapse
#check_plugin_destination
Methods inherited from Command
inherited
Methods included from Usage
extended, included
Class Method Details
.source_root ⇒ Object
9
10
11
|
# File 'lib/jax/generators/model/model_generator.rb', line 9
def self.source_root
File.expand_path("templates", File.dirname(__FILE__))
end
|
Instance Method Details
#resources ⇒ Object
21
22
23
|
# File 'lib/jax/generators/model/model_generator.rb', line 21
def resources
create_file File.join("app", "resources", plural_name, "default.yml"), "# default attribute values\n# (these will apply to all #{plural_name})"
end
|
#source ⇒ Object
13
14
15
|
# File 'lib/jax/generators/model/model_generator.rb', line 13
def source
template 'model.js.tt', File.join("app/models", "#{file_name}.js")
end
|
#test ⇒ Object
17
18
19
|
# File 'lib/jax/generators/model/model_generator.rb', line 17
def test
template 'test.js.tt', File.join('spec/javascripts/models', "#{file_name}_spec.js")
end
|