Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jgaskins/clearwater_mailbox
Tryo Labs mailbox tutorial, but using Clearwater
https://github.com/jgaskins/clearwater_mailbox
Last synced: 22 days ago
JSON representation
Tryo Labs mailbox tutorial, but using Clearwater
- Host: GitHub
- URL: https://github.com/jgaskins/clearwater_mailbox
- Owner: jgaskins
- Created: 2015-04-29T18:11:36.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2015-04-29T19:03:05.000Z (over 9 years ago)
- Last Synced: 2024-12-09T10:55:40.451Z (25 days ago)
- Language: Ruby
- Size: 113 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Clearwater-Mailbox
This is a port of Tryo Labs' [React Mailbox](http://blog.tryolabs.com/2015/04/07/react-examples-mailbox/) example to Clearwater with the virtual DOM.
## Routing
One major difference between using their React version and this version is that this version uses Clearwater's router to manage some of the state rather than storing it in components. The result is that when you refresh, you are in the same place rather than looking at a fresh app.
Here are the routes we're using:
```ruby
Clearwater::Router.new do
mailbox = Mailbox.new
route ':mailbox_id' => mailbox do
route ':email_id' => Email.new(mailbox: mailbox)
end
end
```This means that when we visit `/1/2`, we're looking at the second email in the first mailbox. We pass the parent component into the child component for convenience.