Created
February 7, 2017 20:18
-
-
Save abachuk/56ffc88dbf654d25110b059091c0395a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
actions: { | |
sendContactForm() { | |
// Getting input values. | |
// TODO: add validation before trying to save the values. | |
const submittedForm = { | |
name: this.get('name'), | |
email: this.get('email'), | |
company: this.get('company'), | |
phone: this.get('phone'), | |
message: this.get('message'), | |
timestamp: new Date().getTime() | |
+ }; | |
// Save the submitted form to our database | |
+ const newContact = this.store.createRecord('contact', submittedForm); | |
+ newContact.save().then(function(res) { | |
// display success or fail message to the user after saving the values to DB | |
}); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment