Skip to content

tamarasaurus/sails-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

sails-example

This is super basic example of how to use sails.js to make a simple model and a form that creates a record for that model.

The model 'Submission' has the following attributes:

  id, name, email, latitude, longitude, postcode

In api/models/Submission.js the attributes and validation requirements are defined

The controller for the model is at api/controllers/SubmissionController.js and has one example function to delete all records for the Submission model.

There's a simple form at views/form.ejs that posts to submission/create defined in config/routes.js:

  '/form': {
    view: 'form'
  }

Mongodb is used as the database (sails-mongo) and is configured in config/adapters.js

About

Example application using sails.js

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published