sails-generate-scaffold

0.0.5 • Public • Published

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 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.

More Resources

License

MIT © 2014 irlnathan & contributors

As for Sails? It's free and open-source under the MIT License.

image_squidhome@2x.png

Package Sidebar

Install

npm i sails-generate-scaffold

Weekly Downloads

0

Version

0.0.5

License

MIT

Last publish

Collaborators

  • irl