crud generator
for Sails.The awesomecrudjs
takes the data in the model (the model attributes) and generate the controller, the actions in the controller (e.g. index, create, createModel, edit, show, update, and destroy), and corresponding views of a Sails project. The awesomecrudjs
will also create and copy the files and folders needed (e.g. bootstrap, jquery, jquery-validator).
Step 1:
Download `awesomecrudjs`.
Step 2:
Copy `awesomecrudjs` folder in the root of your Sails project.
Step 3
Open a console inside the `awesomecrudjs` folder. (/path-to-your-project/project_name/awesomecrudjs)
Step 4
Generate!
Generate only one model:
$ node crud_gen.js -m <name_of_the_model>
Or generate all the models:
$ node crud_gen.js -a
One model:
$ node crud_gen.js -m user
Need to add the datatables css files and the corect order of the .js files in the pippeline.js file.
.css
var cssFilesToInject = [
'styles/**/*.css',
//datatables css
'js-plugins/dataTables/datatables.min.css',
];
.js
var jsFilesToInject = [
// Load sails.io before everything else
'js/dependencies/sails.io.js',
// Load jquery
'js/dependencies/jquery-1.12.0.min.js',
'js/dependencies/jquery.validate.min.js',
//datatables
'js-plugins/datatable/datatables.min.js',
// Dependencies like jQuery, or Angular are brought in here
'js/dependencies/**/*.js',
//bootstrap
'js/bootstrap.min.js',
// All of the rest of your client-side js files
// will be injected here in no particular order.
'js/**/*.js'
];
MIT License 2016 SamyOteroGlez & contributors