When you create a model/controller using
sails generate user, which models are available? For instance, I know there some like basic CRUD, etc, but how to see all available methods?
PS: Unless I got it all wrong and there are no CRUD methods at all. I'm still learning Sails, so please forgive if its a silly question.
Basically, there are two groups of actions provided by Sails.js blueprints for a newly generated model/controller pair:
- REST API:
delete /:controller/:id. These are classic REST set that should be the one being used in production. You can enable/disable these blueprints via
- CRUD actions aka shortcuts:
/:controller/destroy/:id. Inspired, by Rails' RESTful conventions, the shortcuts provide a way to call all the REST actions from browser address string, using
GETHTTP method only, which can be very handy for developers. These can be enabled/disabled using
config/controllers.js, and it's a good idea to disable them in production (for example, using local environment settings (
There is currently no discussion for this recipe.
This recipe can be found in it's original form on Stack Over Flow.