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.
$ 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"
}
}
}
$ sails generate scaffold <a name for your scaffold> <optional: attributename:attributetype> <optional: --force>
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.
- Stackoverflow
- #sailsjs on Freenode (IRC channel)
- Professional/enterprise
- Tutorials
- SailsJs.org
MIT © 2014 irlnathan & contributors
As for Sails? It's free and open-source under the MIT License.