Git Product home page Git Product logo

rails-realtime's Introduction

Adding Real-Time To Your RESTful Rails App

This repository contains the code for both the Rails app, and the Node app, that accompanies the blog entry "Adding Real-Time To Your RESTful Rails App".

Steps I Took

Below are some of the steps I took, that were not outlined in the above blog entry. Make sure you have Redis installed and running!

rails new rails_realtime --database=postgresql
cd rails_realtime

rake db:create
rails generate scaffold Book title:string num_pages:integer
rake db:migrate

Add gem 'redis' and gem 'pg' to the Gemfile, then run bundle install.

Creating The Node.js App

mkdir realtime
cd realtime
echo 'Real-Time' > README.md

Then create package.json (see realtime/package.json for reference). From the realtime directory run npm install. In your Rails' .gitignore file add /realtime/node_modules to ignore the installed node modules.

The Backbone.js App

The Backbone.js application resides in app/assets/javascripts. application.js specificies the javascript files that comprise the web application and their load order. If you're building a real production app you may want to look into http://requirejs.org/ to manage your dependencies. app.js.coffee is the starting point for the Backbone.js application.

To Start The App

The Rails App: rails s

The Node App (from the realtime folder): node realtime-server.js

Done

Between the Blog, the code in this repository, and the above steps you should hopefully have the information necessary to add real-time to your Rails app!

rails-realtime's People

Contributors

bdwain avatar liamks avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.