Skip to content

Commit

Permalink
more small tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
SachaG committed Nov 10, 2014
1 parent 744aafb commit 54221ab
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 9 deletions.
4 changes: 2 additions & 2 deletions 02-getting-started.md.erb
Original file line number Diff line number Diff line change
Expand Up @@ -66,15 +66,15 @@ Now point your browser to `http://localhost:3000/` (or the equivalent `http://0.

Congratulations! You've got your first Meteor app running. By the way, to stop the app all you need to do is bring up the terminal tab where the app is running, and press `ctrl+c`.

Also, note that if you're using Git, this is a good time to initialize your repo with `git init`.
Also note that if you're using Git, this is a good time to initialize your repo with `git init`.

<% note do %>

### Bye Bye Meteorite

There was a time where Meteor relied on an external package manager called Meteorite. Since Meteor version 0.9.0, Meteorite is not needed anymore since its features have been assimilated into Meteor itself.

So, if you encounter any references to Meteorite's `mrt` command line utility throughout this book or while browsing Meteor-related material, you can safely replace them by the usual `meteor`.
So if you encounter any references to Meteorite's `mrt` command line utility throughout this book or while browsing Meteor-related material, you can safely replace them by the usual `meteor`.

<% end %>

Expand Down
2 changes: 1 addition & 1 deletion 06-adding-users.md.erb
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ meteor add accounts-password

Those two commands make the special accounts templates available to us, and we can include them in our site using the `{{> loginButtons}}` helper. A handy tip: you can control on which side your log-in dropdown shows up using the `align` attribute (for example: `{{> loginButtons align="right"}}`).

We'll add the buttons to our header. And since that header is starting to grow larger, let's give it more room in its own template (we'll put it in `client/templates/includes/`). We're also using some extra markup and Bootstrap classes to make sure everything looks nice:
We'll add the buttons to our header. And since that header is starting to grow larger, let's give it more room in its own template (we'll put it in `client/templates/includes/`). We're also using some extra markup and classes [as specified by Bootstrap](http://getbootstrap.com/components/#navbar) to make sure everything looks nice:

~~~html
<template name="layout">
Expand Down
2 changes: 1 addition & 1 deletion 07-creating-posts.md.erb
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ Meteor.methods({
}
});
~~~
<%= caption "collections/posts.js" %>
<%= caption "lib/collections/posts.js" %>
<%= highlight "3~24" %>

Note that the `_.extend()` method is part of the [Underscore](http://underscorejs.org) library, and simply lets you “extend” one object with the properties of another.
Expand Down
4 changes: 2 additions & 2 deletions 10-comments.md.erb
Original file line number Diff line number Diff line change
Expand Up @@ -259,8 +259,6 @@ And then create the comment form template:
~~~
<%= caption "client/templates/comments/comment_submit.html" %>

<%= screenshot "10-2", "The comment submit form" %>

To submit our comments, we call a `comment` Method in `comment_submit.js` that operates in a similar way to what we did for submitting posts:

~~~js
Expand Down Expand Up @@ -341,6 +339,8 @@ Meteor.methods({

This is not doing anything too fancy, just checking that the user is logged in, that the comment has a body, and that it's linked to a post.

<%= screenshot "10-2", "The comment submit form" %>

### Controlling the Comments Subscription

As things stand, we are publishing all comments across all posts to all connected clients. That seems a little wasteful. After all, we're only actually using a small subset of this data at any given time. So let's improve our publication and subscription to control exactly which comments are published.
Expand Down
4 changes: 2 additions & 2 deletions 11-notifications.md.erb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ To do so, we'll notify the post's owner that there's been a comment on their pos

This is the kind of feature where Meteor really shines: because Meteor is realtime by default, we'll be displaying those notifications _instantly_. We don't need to wait for the user to refresh the page or check in any way, we can simply pop new notifications up without ever writing any special code.

### Creating notifications
### Creating Notifications

We'll create a notification when someone comments on your posts. In the future, notifications could be extended to cover many other scenarios, but for now this will be enough to keep users informed of what's going on.

Expand Down Expand Up @@ -63,7 +63,7 @@ We are already creating comments in a server-side Method, so we can just augment
Comments = new Mongo.Collection('comments');

Meteor.methods({
comment: function(commentAttributes) {
commentInsert: function(commentAttributes) {

//...

Expand Down
2 changes: 1 addition & 1 deletion 12-pagination.md.erb
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ We have a working pagination, and our code is looking good. There's just one pro

What we want to do is simple enough. We'll add a “load more” button at the bottom of our posts list, which will increment the number of posts currently displayed by 5 every time it's clicked. So if I'm currently on the URL `http://localhost:3000/5`, clicking “load more” should bring me to `http://localhost:3000/10`. If you've made it this far in the book, we trust you can handle a little arithmetic!

As before, we'll add our pagination logic in our route. Remember when we explicitely named our data context rather than just use an anonymous cursor? Well, there's no rule that says the `data` function can only pass cursors, so we'll use the same technique to generate the URL of our “load more” button.
As before, we'll add our pagination logic in our route. Remember when we explicitly named our data context rather than just use an anonymous cursor? Well, there's no rule that says the `data` function can only pass cursors, so we'll use the same technique to generate the URL of our “load more” button.

~~~js
//...
Expand Down
1 change: 1 addition & 0 deletions b-changelog.md.erb
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ Various fixes.
- Fix code highlighting in Voting chapter.
- Change “router” to “route” in Pagination chapter.
- Removed mentions of `Router.map()` in Comments and Pagination chapters.
- Linking to Boostrap site in Adding Users chapter.

### October 28, 2014 <span class="marker version-marker">1.7</span>

Expand Down

0 comments on commit 54221ab

Please sign in to comment.