Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to push content in real time in rails 3
    primarykey
    data
    text
    <p>I'm wondering the way to push content in my site in real time.. I've researched some time and I realized that there are many ways to do this work.</p> <p>Some considerations first: I have a Rails 3 App with some social functionality..one of the features I want to achieve is to notify my users when a new activity is created. My first approach was to implement <a href="http://www.html5rocks.com/en/tutorials/eventsource/basics/" rel="nofollow">SSE</a> and a controller that searches in the DB for new registries after the last loaded activity. </p> <p>This can work but this requires too many DB queries when all I need is to push the activity to all active users (related with that activity) when a new activity is created, without the need to do DB queries..</p> <p>My second approach was to create a route pointing to a controller and an observer to catch when an new activity is created, later pass the current activity created to the controller and finally render the activity partial through SSE.</p> <p>Here comes my problem.. how can connect the observer with the controller and pass it the current activity to be rendered? And there, can I use another controller type such as a Metal Controller or even an Abstract one?</p> <p>In this point I realized that could be another approach to do this job.. It'd be really nice if I could find a way to do this without having to develop it in another language or framework.. I think that should have a gem that could do real time apps easier.. What do you think?? I'm on the right way or what I should do to achieve this?? Many Thanks!!</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload