Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

actions

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

actions

Actions for a resourceful controller, CRUD

  • 1.3.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
29K
increased by39.42%
Maintainers
1
Weekly downloads
 
Created
Source

Actions

Actions for a resourceful controller, CURD.
Rails-like actions.

Source code

// http://guides.rubyonrails.org/routing.html

// Resource
exports.ACTIONS = [
  'index',    // GET        `posts#index`   `/posts`
  'create',   // POST       `posts#create`  `/posts`
  'new',      // GET        `posts#new`     `/posts/new`
  'show',     // GET        `posts#show`    `/posts/:id`
  'update',   // PATCH/PUT  `posts#update`  `/posts/:id`
  'destroy',  // DELETE     `posts#destroy` `/posts/:id`
  'edit'      // GET        `posts#edit`    `/posts/:id/edit`
];

// SingletonResource
exports.SINGLETON_ACTIONS = [
  'show',     // GET        `post#show`    `/post/:id`
  'create',   // POST       `post#create`  `/post`
  'update',   // PATCH/PUT  `post#update`  `/post/:id`
  'destroy',  // DELETE     `post#destroy` `/post/:id`
  'new',      // GET        `post#new`     `/post/new`
  'edit'      // GET        `post#edit`    `/post/:id/edit`
];

// Canonical Actions
exports.CANONICAL_ACTIONS = [
  'index',    // GET        `posts#index`   `/posts`
  'create',   // POST       `posts#create`  `/posts`
  'new',      // GET        `posts#new`     `/posts/new`
  'show',     // GET        `posts#show`    `/posts/:id`
  'update',   // PATCH/PUT  `posts#update`  `/posts/:id`
  'destroy',  // DELETE     `posts#destroy` `/posts/:id`
];

License

MIT

FAQs

Package last updated on 20 Mar 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc