Skip to content
This repository was archived by the owner on Oct 19, 2018. It is now read-only.

Commit eba9e22

Browse files
committed
updated README
1 parent 0fe4232 commit eba9e22

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

README.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ Now your display should look like this:
276276
<br>
277277
You will notice that while it does display the checkboxes, you can not change them by clicking on them.
278278

279-
You can of course change them via the console (or the hyper-console). Try
279+
For now we can change them via the console like we did before. Try executing
280280
`Todo.last.update(completed: true)`
281281
and you should see the last Todo's `completed` checkbox changing state.
282282

@@ -312,13 +312,17 @@ end
312312
```
313313
*Note: If a component or tag block returns a string it is automatically wrapped in a SPAN, to insert a string in the middle you have to wrap it a SPAN like we did above.*
314314

315-
I hope you are starting to see a pattern here. HyperReact components determine what to display based on the `state` of some objects. External events, such as mouse clicks, the arrival of new data from the server, and even timers, update the `state`. HyperReact recomputes whatever portion of the display depends on the `state` so that the display is always in sync with the `state`. In our case the objects are the Todo model and its associated records, which has a number of associated internal `states`.
315+
I hope you are starting to see a pattern here. HyperReact components determine what to display based on the `state` of some
316+
objects. External events, such as mouse clicks, the arrival of new data from the server, and even timers update the `state`. HyperReact recomputes whatever portion of the display depends on the `state` so that the display is always in sync with the `state`. In our case the objects are the Todo model and its associated records, which has a number of associated internal `states`.
316317

317318
By the way, you don't have to use models to have states. We will see later that states can be as simple as boolean instance variables.
318319

319320
### Chapter 6: Routing
320321

321-
Now that Todos can be *completed* or *active*, we would like our user to be able display either "all" Todos, only "completed" Todos, or "active" (or incomplete) Todos. We want our URL to reflect which filter is currently being displayed. So `/all` will display all todos, `/completed` will display the completed Todos, and of course `/active` will display only active (or incomplete) Todos.
322+
Now that Todos can be *completed* or *active*, we would like our user to be able display either "all" Todos,
323+
only "completed" Todos, or "active" (or incomplete) Todos. We want our URL to reflect which filter is currently being displayed.
324+
So `/all` will display all todos, `/completed` will display the completed Todos, and of course `/active` will display only active
325+
(or incomplete) Todos. We would also like the root url `/` to be treated as `/all`
322326

323327
To achieve this we first need to be able to *scope* (or filter) the Todo Model. So let's edit the Todo model file so it looks like this:
324328

0 commit comments

Comments
 (0)