Instant messaging/2 way Chat in Rails

I have a Rails 3.2.16 app which tracks calls, vehicles, and patient
information. I’d like to implement a two-way chat feature similar to
instant messaging where employees can chat with each other via instant
message or a chatroom. Preferably instant message style communication.
I’d also like the main application view to do Ajax notifications of new
messages.

What would be the best way to architect something like this? I’m
looking into Private_Pub gem but there’s a lot of missing pieces that
I’m not sure on how to implement.

Any thoughts or suggestions on this would be greatly appreciated.

James learn how Faye works ( http://faye.jcoglan.com/ ) , it would be
great
start to understand the underlying concepts of private_pub.