I want to build a chat room using Rails, should I use juggernaut 2 or cramp? - ruby-on-rails

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!

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).

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

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 :)

Related

Using ruby with thin for live chat functionality

So my goal is to create some sort of simple chat functionality, and after a few days (that's right days) with no conclusive direction to go, I've decided to post it here. Basically all I need is a global chat channel that any user on the site can open up and contribute. I think I should be using long-polling. I'd like to know if this can be accomplished using what I have now for the site: Ruby on Rails framework, with Backbone.js on top, also using thin gem for server junk. The only question on SO close to what I'm trying to accomplish is here, but it is an incredibly vague answer. Keep it simple please, while I am pretty well off in most ruby and javascript stuff, this server side event business is basically brand new to me.
I recomend you to try to use private_pub gem https://github.com/ryanb/private_pub
It's using Faye server, and it's easy to use and pretty fast

What's the benefit of using Sinatra instead of RoR if I'm only need a DB and an API

I need to build a web service, for a mobile game, to manage the states of multiplayer games. I need a database and an RESTful API to access it. I'm very familiar with Ruby On Rails and was thinking of using that since I can throw together the DB and API pretty quickly. However, since RoR is a framework for building web pages and I'm not actually building any web pages, it naturally seems like the wrong technology to use even though it would work. As such, I'm considering using Ruby on Sinatra, but I've never used it before and I'll have to kill some time learning it. For you Ruby gurus, is there an advantage to using Sinatra or a disadvantage to using RoR for what I'm trying to accomplish?
Thanks so much in advance for your wisdom!
You know Rails, you don't know Sinatra. Personally I prefer the latter for things like building APIs, but there's nothing stopping you from doing it in Rails, and there's nothing intrinsically wrong with it either. Unless you want to see this as a learning opportunity for getting into Sinatra, I'd say stick with Rails. Here's some links that might be useful btw:
Building APIs With Rails
Building a Platform API on Rails
It probably depends on your API. If you need more than just a bunch of routes then you will have to come up with your own solutions (authentication, ...).
If all you need is some RESTfulness without the added weight, Sinatra is great. All you need to know is what happens in what route and you're fine. See the Sinatra Readme which has all the information to get started.

How to create SOAP api webserices in rails3.1

I want to know whether it is possible to create SOAP APIs in RAILS. I googled and found that SAVON can be used for communicating with SOAP API, is their anyway to create soap apis in rails 3.
We've just released 0.3.2 of https://github.com/roundlake/wash_out with new tiny features. It's currently active and maintained (unlike ActionWebService). And is probably best way to do what you want.
However even being maintainer of such a gem I do not recommend you to use SOAP at all. WashOut was created for the cases where you have no choice. So please think twice. In most cases REST is much more preferable.
There's a gem called actionwebservice that served this purpose many years ago. There are a few people who have maintained it along the way, but you might have to dig around. Searching ruby gems.org brings up a few results but it seems like even these are not really maintained. You might want to check out some of the forks too and see if they are still being maintained.
Having said that, if you have the option to not use SOAP, don't. Use REST as support for it is built into Rails and likely isn't going away any time soon.
Check this gem - https://github.com/roundlake/wash_out

Web App that uses Webcam...any Rails plugins/gems?

I;m a developer looking to make an app similar to chat roulette. I'm pretty comfortable with Ruby on Rails as my platform and would like to program it in that.
The downside is I have no idea about how to do anything using webcams.
Is there a plugin or gem for rails that integrates webcams easily?
Some quick browsing brought me to abobes site...but I haven't used it before, and though I dont mind learning new things, I'd like to get this out quickly so I'd rather stick to what I know.
What you do you use for webcams?
You would have to use a third-party plug-in to interface the webcam with the site. Rails takes care of things on the back-end (finding and connecting users) but you would need to use Flash or something similar to connect the web page with the camera.
This question is pretty old, but we've been able to use headshot gem in one of our apps.
https://github.com/diwadm/headshot

Which CouchDB API to use for Rails?

I am currently investigating possible applications of CouchDB on my current project (written in Rails) and would like to get some feedback from people who have actually used these APIs. Which would you recommend and why?
ActiveCouch
CouchFoo
CouchRest
CouchRest-Rails
CouchPotato
The basic layer of CouchRest is probably the best to get started, CouchPotato is the most active for Rails integration, SimplyStored adds some nicities on top of CouchPotato
With Rails 3 use (or at least seriously consider using) CouchRest Model. It appears to be well maintained, since as of this update on 2013/12/19 I see several changes that are only 2 weeks old.
Before considering SimplyStored, you should note that they give this warning on Github:
Development work as stopped as we don't use SimplyStored anymore. Please do not expect any future commits and fixes.
Perhaps someone will pick it up, as it looks very useful.
I am going through the same process. You might find SimplyStored interesting if you haven't already given it a look.
http://github.com/peritor/simply_stored

Resources