sails-generate-scaffold
Note: This module requires Sails v0.10.0-rc8 or higher.
A scaffold
generator for use with the Sails command-line interface. A scaffold
generates a rudimentary model, CRUD controller actions (e.g. index, new, create, edit, update, and destroy), and corresponding views of a Sails project. The scaffold
generator will also create a policy that enables flash messages for errors on the new and edit views.
To install:
$ npm install sails-generate-scaffold
Next open up the .sailsrc
file located in the root of your sails project. Add the scaffold
by typing:
{ "generators": { "modules": { "scaffold": "sails-generate-scaffold" } }}
To create a scaffold
On the command line
$ sails generate scaffold <a name
Example:
$ sails generate scaffold user name:string age:integer email:email
The first argument will be the model
and controller
name. You can add any number of model attributes and types. Finally, you can overwrite an existing scaffold by using the --force
parameter.
More Resources
- Stackoverflow
- #sailsjs on Freenode (IRC channel)
- Professional/enterprise
- Tutorials
License
MIT © 2014 irlnathan & contributors
As for Sails? It's free and open-source under the MIT License.