instiki/vendor/rails/railties/lib/rails_generator/generators/components/model/USAGE

20 lines
670 B
Plaintext
Raw Normal View History

2007-01-22 14:43:50 +01:00
Description:
The model generator creates stubs for a new model.
The generator takes a model name as its argument. The model name may be
given in CamelCase or under_score and should not be suffixed with 'Model'.
The generator creates a model class in app/models, a test suite in
test/unit, test fixtures in test/fixtures/singular_name.yml, and a migration
in db/migrate.
Example:
./script/generate model Account
This will create an Account model:
Model: app/models/account.rb
Test: test/unit/account_test.rb
Fixtures: test/fixtures/accounts.yml
Migration: db/migrate/XXX_add_accounts.rb