Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * CustomerController
- *
- * @description :: Server-side actions for handling incoming requests.
- * @help :: See https://sailsjs.com/docs/concepts/actions
- */
- module.exports = {
- 'new': function (req, res) {
- res.view();
- }
- };
- <form action="/customer/create" method="POST">
- <h2> Create customer</h2>
- <input type="text" placeholder="Name" name="name" ></br/>
- <input type="text" placeholder="Email" name= "email" ></br/>
- <input type="text" placeholder="State" name = "state" ><br/>
- <input type="submit" value="Create Customer"/>
- </form>
- /**
- * Customer.js
- *
- * @description :: A model definition. Represents a database table/collection/etc.
- * @docs :: https://sailsjs.com/docs/concepts/models-and-orm/models
- */
- module.exports = {
- attributes: {
- name: {
- type: 'string',
- required: true
- },
- email: {
- type:'string',
- isEmail: true
- },
- state: {
- type: 'string'
- }
- },
- };
Add Comment
Please, Sign In to add comment