0

What is the best way for a browser to receive new records entered into a Rails DB, without having to refresh the page?

Example

I have a website with Rails as the backend.

On one page, I show a post. It has comments and upvotes.

Whenever a new comment or upvote is created, I want the browser to receive it in near real time and render it on to the page.

If it matters, my front-end is done in AngularJS.

Don P
  • 49,839
  • 95
  • 259
  • 394
  • This is not a simple task - you will need redis and additional node server. Have a read: http://liamkaufman.com/blog/2013/02/27/adding-real-time-to-a-restful-rails-app/ – BroiSatse Jan 29 '15 at 21:20
  • http://stackoverflow.com/questions/7385158/rails-3-real-time-server-push http://www.slideshare.net/piotrkarbownik5/rails-4-server-sent-events – Nicholas Hirras Jan 29 '15 at 21:24
  • https://pusher.com/ this looks like an awesome solution instead of implementing it myself. $20 / month. (I don't work or have any relation to this company, just google searched) – Don P Jan 29 '15 at 23:45

0 Answers0