Is there a way to keep a controller instance variable across a link_to_remote call? In essence, I want the call to re-render a partial within my page with different display parameters, but without doing another DB call. Is there a simple way to do this?
on 2006-05-16 01:49
on 2006-05-16 06:40
Are the variables short enough that you can serialize them and stuff them inside parameters in the URL? It's ugly but functional, and requires no back-end help. (Or turn it into a POST for longer strings.) - James
on 2006-05-16 09:21
James M. wrote: > Are the variables short enough that you can serialize them and stuff them > inside parameters in the URL? It's ugly but functional, and requires no > back-end help. (Or turn it into a POST for longer strings.) > Nope. I'm talking a fairly hefty Foo.find(:all, :include => [...])... So there's good reason not to want to re-execute the query just so I can redisplay with different parameters.
on 2006-05-16 14:48
Is there a problem with storing the results of the query in a session variable?
on 2006-05-17 00:58
Mick S. wrote: > Is there a problem with storing the results of the query in a session > variable? > Not really, although I'd prefer if it didn't persist to the database or filesystem. I'm also concerned about making sure that it gets cleared as soon as I leave the page... Thinking it through a bit further, it seems that there are really only two solutions: 1) Store in the session, in which case, I want to get it cleared as soon as I leave the page. * Is there a callback or such that handles this? 2) Create a data structure in JS and do the redisplay entirely on the client side. * Has anyone experience with this? Possible with RJS? Thanks for any help.