Skip to content

Commit

Permalink
Fixes #2 - Another typo
Browse files Browse the repository at this point in the history
  • Loading branch information
antoviaque committed Jun 7, 2012
1 parent 8010131 commit 0ef6244
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion tutorial/tutorial.html
Expand Up @@ -290,7 +290,7 @@ <h4 id="view">View</h4>
});
</code></pre>
<p>Here, we give the visitor the ability to post a new message in the current thread. We monitor clicks on the submit button, retreive the data the user entered using jQuery selectors (<code class="javascript">this.$('.class')</code> is a shortcut for <code>$('.class', this.el)</code>), instantiate a new <code>Message</code> object with the user data, and get Backbone to send it to the API with the <code>save()</code> method. This will send the data to <code>/api/message</code> as a POST request. The <code>message.thread</code> attribute will be set to the value of <code>thread._id</code>, to let the server know which thread to add the message to.</p>
<p>Since we're adding a new message to <code class="javascript">thread.messages</code>, Backbone-relational will trigger the "messages:add" event, and the new message will get automatically inserted in the DOM via the <code>render_message()</code> method - no extra effort required!</p>
<p>Since we're adding a new message to <code class="javascript">thread.messages</code>, Backbone-relational will trigger the "add:messages" event, and the new message will get automatically inserted in the DOM via the <code>render_message()</code> method - no extra effort required!</p>
<h3 id="messageview">MessageView</h3>
<h4 id="template_1">Template</h4>
<pre><code class="javascript">&lt;script type="text/template" id="tpl_message"&gt;
Expand Down
2 changes: 1 addition & 1 deletion tutorial/tutorial.txt
Expand Up @@ -338,7 +338,7 @@ Note that the thread template doesn't attempt to represent the thread's messages

Here, we give the visitor the ability to post a new message in the current thread. We monitor clicks on the submit button, retreive the data the user entered using jQuery selectors (`this.$('.class')` is a shortcut for `$('.class', this.el)`), instantiate a new `Message` object with the user data, and get Backbone to send it to the API with the `save()` method. This will send the data to `/api/message` as a POST request. The `message.thread` attribute will be set to the value of `thread._id`, to let the server know which thread to add the message to.

Since we're adding a new message to `thread.messages`, Backbone-relational will trigger the "messages:add" event, and the new message will get automatically inserted in the DOM via the `render_message()` method - no extra effort required!
Since we're adding a new message to `thread.messages`, Backbone-relational will trigger the "add:messages" event, and the new message will get automatically inserted in the DOM via the `render_message()` method - no extra effort required!

### MessageView

Expand Down

0 comments on commit 0ef6244

Please sign in to comment.