[Pkg-javascript-commits] [backbone] 37/211: adding a bit more explanation to Model#save onError
Jonas Smedegaard
js at moszumanska.debian.org
Sat May 3 16:59:59 UTC 2014
This is an automated email from the git hooks/post-receive script.
js pushed a commit to tag 0.5.0
in repository backbone.
commit e3aa5751ac3af91b0890d3b37b39512b0db0bb92
Author: Jeremy Ashkenas <jashkenas at gmail.com>
Date: Mon Dec 20 12:31:58 2010 -0500
adding a bit more explanation to Model#save onError
---
index.html | 14 ++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)
diff --git a/index.html b/index.html
index eb68b91..8b1353d 100644
--- a/index.html
+++ b/index.html
@@ -708,10 +708,7 @@ setInterval(function() {
method, and validation fails, the model will not be saved. If the model
<a href="#Model-isNew">isNew</a>, the save will be a <tt>"create"</tt>
(HTTP <tt>POST</tt>), if the model already
- exists on the server, the save will be an <tt>"update"</tt> (HTTP <tt>PUT</tt>). Accepts
- <tt>success</tt> and <tt>error</tt> callbacks in the options hash, which
- are passed <tt>(model, response)</tt> as arguments. The <tt>error</tt> callback will
- also be invoked if the model has a <tt>validate</tt> method, and validation fails.
+ exists on the server, the save will be an <tt>"update"</tt> (HTTP <tt>PUT</tt>).
</p>
<p>
@@ -732,6 +729,15 @@ var book = new Backbone.Model({
book.save();
</pre>
+ <p>
+ <b>save</b> accepts <tt>success</tt> and <tt>error</tt> callbacks in the
+ options hash, which are passed <tt>(model, response)</tt> as arguments.
+ The <tt>error</tt> callback will also be invoked if the model has a
+ <tt>validate</tt> method, and validation fails. If a server-side
+ validation fails, return a non-<tt>200</tt> HTTP response code, along with
+ an error response in text or JSON.
+ </p>
+
<p id="Model-destroy">
<b class="header">destroy</b><code>model.destroy([options])</code>
<br />
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/backbone.git
More information about the Pkg-javascript-commits
mailing list