2.0.0 • Published 8 years ago

ember-cli-scaffold v2.0.0

Weekly downloads
16
License
MIT
Repository
github
Last release
8 years ago

Ember-cli-scaffold

Scaffolds models, routes and templates a la rails

Build Status Ember Observer Score

Requirements

This addon requires Ember, Ember Data and Ember CLI at version 2.0 or higher. Additionally, it will install ember-cli-mirage, of which at least version 0.2.0 is required.

Installation

In your ember-cli app, do ember install ember-cli-scaffold

Usage

ember generate scaffold user first_name:string last_name:string age:number
open http://localhost:4200/users

This command generates the following files:

  • app/mixins/users/save-model-mixin.js
  • app/routes/users/edit.js
  • app/routes/users/index.js
  • app/routes/users/new.js
  • app/templates/users/-form.hbs
  • app/templates/users/edit.hbs
  • app/templates/users/index.hbs
  • app/templates/users/new.hbs
  • app/templates/users/show.hbs
  • app/models/user.js
  • app/mirage/factories/user.js
  • tests/acceptance/users-test.js

These files contain all the CRUD operations and an acceptance test with all tests passing. In order to provide a fake server in both development and tests ember-cli-mirage is used.

It's also possible to generate using the pod structure, just pass the -pod flag to scaffold generator.

To remove the generated files just use the ember destroy scaffold <model-name> command. For instance ember destroy scaffold user.

Running Tests

npm test

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request
2.0.0

8 years ago

1.1.4

8 years ago

1.1.3

8 years ago

1.1.2

8 years ago

1.1.1

8 years ago

1.1.0

9 years ago

1.0.0

9 years ago

0.1.1

9 years ago

0.1.0

9 years ago

0.0.12

9 years ago

0.0.11

9 years ago

0.0.10

9 years ago

0.0.9

9 years ago

0.0.8

9 years ago

0.0.7

9 years ago

0.0.6

9 years ago

0.0.5

9 years ago

0.0.4

10 years ago

0.0.3

10 years ago

0.0.2

10 years ago

0.0.1

10 years ago