In this post I am going to show how to use private_pub gem on heroku. Before going to use it we have to setup private_pub server on heroku. Use this link to setup the server.
Private Pub gem is a very nice solution for pushing real time data and it’s open-source . Now create a rails app using “rails new demo_private_pub”. Then we have to add the gems given below
<%= subscribe_to "/messages/new" %> # use this for subscribing to a channel
<% publish_to "/messages/new" do %> # use this for publishing the data to a channel. $("#post-list-div").append("<%= j render(@post) %>"); <% end %> You can checkout my live chat application at http://batkaro.herokuapp.com Also you can checkout my github code at https://github.com/Hareramrai/batkaro