I want to build a chat room using Rails, should I use juggernaut 2 or cramp?
Asked Answered
S

3

6

Originally I planned to use Juggernaut, however, it is not compatible with Rails 3. And new Juggernaut 2 seems to be completely independent from Rails, which is not what I want. Then I found cramp, it looks quite neat, but is still under development. So I am just wondering which framework should I use? Or is there a better one? Thanks!

Showmanship answered 29/1, 2011 at 23:41 Comment(0)
A
6

I have looked at the options for this stuff quite extensively and real-time chat is a bit against the grain of Rails. If you really want to stay inside Rails, then Cramp is probably the best option. I recommend you have a look at this article on Websockets and Rails as well: http://www.igvita.com/2009/12/22/ruby-websockets-tcp-for-the-browser/

Using EventMachine to handle the communication means you are that even though you will still be outside Rails, you are at least in Ruby and can share models and libraries.

I have a Async Rails build on GitHub: https://github.com/tobyhede/AsyncRails

Which is largely based on: https://github.com/igrigorik/async-rails

Attalie answered 30/1, 2011 at 1:26 Comment(0)
Y
12

You're right that the new Juggernaut is de-coupled from Rails, but that doesn't mean you can't use the two together. Juggernaut comes with a Ruby library. Using Juggernaut solves the long-lived connection problem that Toby was talking about.

Any questions about Juggernaut, ping me a line (I'm the creator).

Yachting answered 30/1, 2011 at 7:57 Comment(1)
I just added realtime support to an app using Juggernaut and was highly impressed.Mardellmarden
A
6

I have looked at the options for this stuff quite extensively and real-time chat is a bit against the grain of Rails. If you really want to stay inside Rails, then Cramp is probably the best option. I recommend you have a look at this article on Websockets and Rails as well: http://www.igvita.com/2009/12/22/ruby-websockets-tcp-for-the-browser/

Using EventMachine to handle the communication means you are that even though you will still be outside Rails, you are at least in Ruby and can share models and libraries.

I have a Async Rails build on GitHub: https://github.com/tobyhede/AsyncRails

Which is largely based on: https://github.com/igrigorik/async-rails

Attalie answered 30/1, 2011 at 1:26 Comment(0)
A
0

Well - you could also try Socky: https://github.com/socky/socky-server-ruby

It's ruby-based, and uses WebSocket as base with flash fallback to support most devices. Also it's complete ruby-based so give it a try if you want :)

Aircrewman answered 7/2, 2011 at 7:51 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.