Pages

Tuesday, May 17, 2011

juggernaut



The Juggernaut plugin for Ruby on Rails aims to revolutionize your Rails app by letting the server initiate a connection and push data to the client. In other words your app can have a real time connection to the server with the advantage of instant updates. Although the obvious use of this is for chat, the most exciting prospect is collaborative cms and wikis.



Install
  1. nstall the prerequisites
  2. execute the command in rails:
  3. ruby script/plugin install git://github.com/maccman/juggernaut_plugin.git
          
  4. Add this to any pages you want Juggernaut 'enabled':
  5. <%= javascript_include_tag 'prototype', :juggernaut %>
          
  6. Also add this to the head of any views you want to use Juggernaut:
  7. <%= juggernaut %>
            
  8. Install the gem:
  9. sudo gem install juggernaut
            
  10. Configure the gem:
  11. juggernaut -g juggernaut.yml
           
  12. Start the push server:
  13. juggernaut -c juggernaut.yml
            
  14. Now, visit the view you made earlier, you should see a msg saying 'Juggernaut Connected on localhost:5001' (If you're using Firebug it'll appear in that, otherwise it'll be an alert)
  15. Then, to send data to juggernaut, execute this in the console:
  16. Juggernaut.send_to_all("alert('hi from juggernaut')"
     
     
    this is the link : http://juggernaut.rubyforge.org/ 

No comments:

Post a Comment