Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Typo fix #138

Open
wants to merge 2 commits into
base: gh-pages
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions _posts/2011-01-29-what-is-a-model.md
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ If we instantiate a model with an `id`, Backbone.js will automatically perform a
{% highlight javascript %}

// Here we have set the `id` of the model
var user = new Usermodel({id: 1});
var user = new UserModel({id: 1});

// The fetch below will perform GET /user/1
// The server should return the id, name and email from the database
Expand All @@ -225,7 +225,7 @@ We will use the `save` api call which is intelligent and will send a PUT request
{% highlight javascript %}

// Here we have set the `id` of the model
var user = new Usermodel({
var user = new UserModel({
id: 1,
name: 'Thomas',
email: '[email protected]'
Expand All @@ -237,6 +237,9 @@ We will use the `save` api call which is intelligent and will send a PUT request
user.save({name: 'Davis'}, {
success: function (model) {
alert(user.toJSON());
},
error: function () {
alert("Oops! Could not save the user");
}
});

Expand All @@ -250,7 +253,7 @@ When a model has an `id` we know that it exists on the server, so if we wish to
{% highlight javascript %}

// Here we have set the `id` of the model
var user = new Usermodel({
var user = new UserModel({
id: 1,
name: 'Thomas',
email: '[email protected]'
Expand Down