-
-
Save chapel/777009 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
this.post('#/reply', function (context) { | |
var fields = this.params, doc = {}; | |
doc.content = fields['post']; | |
doc.datetime = new Date.now(); | |
doc.thread_id = fields['thread_id']; | |
doc.type = 'post'; | |
doc.user_id = 'chapel'; | |
console.log(doc); | |
db.saveDoc(doc, { | |
success: function() { | |
this.redirect('#/thread/'+fields.thread_id); | |
}, | |
error: function() { | |
alert('Error saving document.'); | |
this.redirect('#/thread/'+fields.thread_id); | |
} | |
}); | |
return false; | |
}); |
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
<div id="reply"> | |
<form action="#/reply" method="POST"> | |
<input type="hidden" name="thread_id" value="" /> | |
<textarea name="post" cols=100 rows=10></textarea> | |
<p><input type="submit" value="Reply" /></p> | |
</form> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment