Ember-Rest Example with Websockets
This modifies the Ember-Rest Example as introduced in the blogpost Beginning Ember.js on Rails. I added some simple websockets as a proof-of-concept. Now when one user adds or updates a contact in one browser, other browsers will automatically update. Will refine this in the future. All contents of the original README were left intact beneath my own additions.
Make sure to run bundle to install the gems and setup the database:
bundle install bundle exec rake db:migrate
Follow all steps for setting up Juggernaut. Verify juggernaut is working correctly.
Start your servers in this order: First Redis, then Juggernaut, then Rails. If all three servers are running correctly, you can now open two seperate browsers on your machine and point them to http://localhost:3000/ . Changes or additions made in one browser will be immediately reflected in the other.
Modified the gemfile to include juggernaut. Ran 'bundle install'
Added the line:
to app/views/layouts/application.html.erb . There is probably a more "rails" way to do this, but for now we just want to get things rolling. Will look into it later.
To app/controllers/contacts_controller.rb in both the create and update actions. My additions end here and the original README begins below.
Ember REST Example
This is a simple Rails 3.2 app created to demonstrate using Ember.js with a basic RESTful persistence strategy.
The app itself is a single-page Ember.js take on Rails CRUD scaffolding. It is one of several similar examples I'm creating to try out Ember.js and different persistence strategies.
I extracted the ultra-simple ember-rest.js from this example: https://github.com/cerebris/ember-rest
Assuming Ruby 1.9.2+ with bundler gem installed:
$ bundle install $ bundle exec rake db:migrate $ rails s
Please help improve this example by filing issues and pull requests!
Copyright 2012 Dan Gebhardt. MIT License (see LICENSE for details).