Guest User

Untitled

a guest
Jul 18th, 2018
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.95 KB | None | 0 0
  1. /**
  2. * CustomerController
  3. *
  4. * @description :: Server-side actions for handling incoming requests.
  5. * @help :: See https://sailsjs.com/docs/concepts/actions
  6. */
  7.  
  8. module.exports = {
  9.  
  10. 'new': function (req, res) {
  11. res.view();
  12. }
  13.  
  14.  
  15. };
  16.  
  17. <form action="/customer/create" method="POST">
  18.  
  19. <h2> Create customer</h2>
  20.  
  21. <input type="text" placeholder="Name" name="name" ></br/>
  22. <input type="text" placeholder="Email" name= "email" ></br/>
  23. <input type="text" placeholder="State" name = "state" ><br/>
  24.  
  25. <input type="submit" value="Create Customer"/>
  26.  
  27. </form>
  28.  
  29. /**
  30. * Customer.js
  31. *
  32. * @description :: A model definition. Represents a database table/collection/etc.
  33. * @docs :: https://sailsjs.com/docs/concepts/models-and-orm/models
  34. */
  35.  
  36. module.exports = {
  37.  
  38. attributes: {
  39.  
  40. name: {
  41. type: 'string',
  42. required: true
  43. },
  44.  
  45. email: {
  46. type:'string',
  47. isEmail: true
  48. },
  49.  
  50. state: {
  51. type: 'string'
  52. }
  53. },
  54. };
Add Comment
Please, Sign In to add comment