SamyOteroGlez / awesomecrud-js

A crud generator for Sails.
MIT License
8 stars 0 forks source link

awesomecrud-js

image_squidhome@2x.png

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

Requirements :

To install:

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!

To generate:

On the command line

Generate only one model:

$ node crud_gen.js -m <name_of_the_model>

Or generate all the models:

$ node crud_gen.js -a
Example:

One model:

$ node crud_gen.js -m user

One more thing:

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'
];
In order to use the breadcrumb system click [here breadcrumb.js] (https://github.com/SamyOteroGlez/breadcrumb.js)
Note: Tested with Sails v0.12

Features

More Resources

License

MIT License 2016 SamyOteroGlez & contributors