Actions for a resourceful controller, CRUD
npm install actionsActions for a resourceful controller, CURD.
___Rails-like actions.___
``js
// http://guides.rubyonrails.org/routing.html
// Resource
exports.ACTIONS = [
'index', // GET posts#index /postsposts#create
'create', // POST /postsposts#new
'new', // GET /posts/newposts#show
'show', // GET /posts/:idposts#update
'update', // PATCH/PUT /posts/:idposts#destroy
'destroy', // DELETE /posts/:idposts#edit
'edit' // GET /posts/:id/edit
];
// SingletonResource
exports.SINGLETON_ACTIONS = [
'show', // GET post#show /post/:idpost#create
'create', // POST /postpost#update
'update', // PATCH/PUT /post/:idpost#destroy
'destroy', // DELETE /post/:idpost#new
'new', // GET /post/newpost#edit
'edit' // GET /post/:id/edit
];
// Canonical Actions
exports.CANONICAL_ACTIONS = [
'index', // GET posts#index /postsposts#create
'create', // POST /postsposts#new
'new', // GET /posts/newposts#show
'show', // GET /posts/:idposts#update
'update', // PATCH/PUT /posts/:idposts#destroy
'destroy', // DELETE /posts/:id``
];
MIT