Blueprint actions (not to be confused with blueprint action routes) are
generic actions designed to work with any of your controllers that have a model
of the same name (e.g. ParrotController
would need a Parrot
model). Think of
them as the default behavior for your application. For instance, if you have a
User.js
model and an empty UserController.js
controller, find
, create
,
update
, destroy
, populate
, add
and remove
actions exist implicitly,
without you having to write them.
By default, the blueprint RESTful routes and shortcut routes are bound to their
corresponding blueprint actions. However, any blueprint action can be overridden
for a particular controller by creating a custom action in that controller file
(e.g. ParrotController.find
). Alternatively, you can override the blueprint
action everywhere in your app by creating your own custom blueprint action.
Sails ships with the following blueprint actions: