Skip to content
gavit edited this page Sep 13, 2010 · 21 revisions

Installation Instructions.

Install Twister

You can visit their website for instructions 1

Install Orbited

You can visit their website for the latest2 instructions

  • Download ez_setup.py
  • python ez_setup.py setuptools
  • easy_install orbited
  • If you will use an external stomp server, download the orbited.cfg

Install stomp

  • gem install stomp

Install plugin

  • cd YOUR_APP && script/plugin install git://github.com/mallio/orbited

Deployment Instructions

  • cd YOUR_APP && script/sever
  • /usr/local/bin/orbited —config=config/orbited.cfg
  • If you chose to use an external stomp server, start the external stomp server

Source code

Controller


class MyController < ApplicationController
  def add_line
    data = render_to_string :update do |page|
      page["#chat-window"].append params[:entry]
    end
    Orbited.send_data('hello', data) #TODO test if this works
  end
end

View

Assuming you use JQuery.
form_remote_tag #TODO replace with JQuery code


content_for(:head){ <%= orbited_javascript %> #TODO Shouldn't need to include prototype when using JQuery <%= stomp_connect('hello', :onerror => 'errorHandler', :onclose => 'function(){alert("closed!")}', :js => 'jquery') %> }

<%- form_remote_tag :url => {:controller => ‘participants’, :action => :add_line}, :method => :put do >
<
= text_field_tag ‘entry’ >
<
= submit_tag (‘Say’) >
<
end -%>


routes.rb


  map.resources :MyController, :collection => { :add_line => :put}

Resources:

1 Twisted
fn2. Orbited Installation Instructions

Clone this wiki locally