Sending changing params through periodically_call_remote
Posted
by seaneshbaugh
on Stack Overflow
See other posts from Stack Overflow
or by seaneshbaugh
Published on 2010-05-02T12:21:59Z
Indexed on
2010/05/02
12:27 UTC
Read the original article
Hit count: 277
I'm using periodically_call_remote to update a portion of a page that contains a list of objects. I send along with the url a param containing the created_at date for the most recent object in the database. The action that is called then get all the objects that have been created since then and renders a partial which displays them at the top of the list. The problem is that I can't seem to figure out how to make it so that the next time periodically_call_remote triggers it sends along the created_at date for the new most recent object (if there is one). I tried putting the periodically_call_remote inside the partial that is being rendered but that caused all sorts of problems (http://www.ruby-forum.com/topic/101614 explains why you shouldn't do that). Is there some way I can make periodically_call_remote send along a new param each time it's called? As it stands right now it just sends the same one over and over which means that new objects get rendered more than once.
© Stack Overflow or respective owner