Skip to content
Merged
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
34 changes: 17 additions & 17 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1586,19 +1586,19 @@ <h2 id="Collection">Backbone.Collection</h2>
</ul>

<pre>
Books.each(function(book) {
books.each(function(book) {
book.publish();
});

var titles = Books.map(function(book) {
var titles = books.map(function(book) {
return book.get("title");
});

var publishedBooks = Books.filter(function(book) {
var publishedBooks = books.filter(function(book) {
return book.get("published") === true;
});

var alphabetical = Books.sortBy(function(book) {
var alphabetical = books.sortBy(function(book) {
return book.author.get("name").toLowerCase();
});
</pre>
Expand Down Expand Up @@ -1664,8 +1664,8 @@ <h2 id="Collection">Backbone.Collection</h2>

<pre>
&lt;script&gt;
var Accounts = new Backbone.Collection;
Accounts.reset(&lt;%= @accounts.to_json %&gt;);
var accounts = new Backbone.Collection;
accounts.reset(&lt;%= @accounts.to_json %&gt;);
&lt;/script&gt;
</pre>

Expand Down Expand Up @@ -1925,10 +1925,10 @@ <h2 id="Collection">Backbone.Collection</h2>
alert(method + ": " + model.url);
};

var Accounts = new Backbone.Collection;
Accounts.url = '/accounts';
var accounts = new Backbone.Collection;
accounts.url = '/accounts';

Accounts.fetch();
accounts.fetch();
</pre>

<p>
Expand Down Expand Up @@ -1981,9 +1981,9 @@ <h2 id="Collection">Backbone.Collection</h2>
model: Book
});

var NYPL = new Library;
var nypl = new Library;

var othello = NYPL.create({
var othello = nypl.create({
title: "Othello",
author: "William Shakespeare"
});
Expand Down Expand Up @@ -3616,11 +3616,11 @@ <h2 id="faq">F.A.Q.</h2>

});

var Inbox = new Mailbox;
var inbox = new Mailbox;

// And then, when the Inbox is opened:

Inbox.messages.fetch();
inbox.messages.fetch();
</pre>

<p>
Expand Down Expand Up @@ -3674,10 +3674,10 @@ <h2 id="faq">F.A.Q.</h2>

<pre>
&lt;script&gt;
var Accounts = new Backbone.Collection;
Accounts.reset(&lt;%= @accounts.to_json %&gt;);
var Projects = new Backbone.Collection;
Projects.reset(&lt;%= @projects.to_json(:collaborators => true) %&gt;);
var accounts = new Backbone.Collection;
accounts.reset(&lt;%= @accounts.to_json %&gt;);
var projects = new Backbone.Collection;
projects.reset(&lt;%= @projects.to_json(:collaborators => true) %&gt;);
&lt;/script&gt;
</pre>

Expand Down