A todo list built on the Reaction framework. This is intended to be a minimal example. The annotated source is available here.
- Clone.
$> git clone https://github.com/jimjh/reaction-todos
- Install.
$> bundle install
- Migrate.
$> rake db:setup
- Run.
$> bundle exec rails server
Open up two different browsers (I tried this in Chrome and Safari) and point them to http://localhost:3000. Changes made in one browser are immediately updated in the other.
Except for the following places, Todos is just a regular Rails app.
Gemfile
- added the reaction and thin gems- config/routes.rb - added
mount_reaction
to start the push server - app/controllers/todos_controller.rb - included
Reaction::Rails::Publisher
and usedrespond_with
in every action - app/assets/javascripts/application.js - imported backbone, amplify, and reaction
Finally, app/assets/javascripts/init.js contains a regular Backbone app, adapted from the Backbone tutorial. The templates are in app/views/home/index.html.erb.
Special thanks to Sindre Sorhus and TodoMVC for the great-looking todo list.