RailsCasts Pro episodes are now free!

Learn more or hide this

3dd13's Profile

GitHub User: 3dd13

Site: http://3dd13.me

Comments by 3dd13

Avatar

sounds like you are handling 2 different use cases:
* data publishing and subscription
* keep-alive ping-pong

I suggest do not use private_pub to keep track if user is opening the website in the browser. instead, go deep into faye and use the ping feature.
have a look at:
https://github.com/faye/faye-websocket-ruby

Avatar

I just spent some time and made it. not sure if you have already figured it out or not.

After you deployed your Ruby web app (Rails, Sinatra, ...) to heroku, you should setup another heroku apps for Faye. Either you use the same Ruby web app source code or use Faye-Heroku-Cedar.
to start the Faye correctly on heroku, the key point is about the Procfile.

what Procfil does in this case is just running the "rakeup -R private_pub.ru" command to start the service.

checkout Faye-Heroku-Cedar and heroku document about Procfile

Avatar

just a supplement to Steven. I had problem with that as well.

If you use Firebug, you should see an javascript error in the console saying PubSub not found or undefined (something like that).

It is because in the layout twitter-bootstrap-rails put the <%= javascript_include_tag "application" %> at the bottom.
which is after the <%= subscribe_to .... %> is being called.

so, by moving that <%= javascript_include_tag "application" %> back to the top. the private_pub should work well with bootstrap-rails generated code