Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

what is a good introduction to AJAX in Ruby On Rails?

I need some good introductory pointers to AJAX in the context of a Ruby On Rails app.

Here's the scoop: My app spins off several tasks using Delayed::Job. While the tasks are busy sprunging data from external sites, I want to keep the user appraised of their progress. I don't want to refresh the entire page -- just a rectangle on the page where each task can display status messages.

I don't believe I need a full push technology -- it is sufficient to use javascript-initiated polling to update the screen as long as bg tasks are running.

That's an appropriate scenario for AJAX (right?), and I think Rails3 has specific constructs to support AJAX-y interactions with browsers (right?). Ryan Bates's Railscast on Polling For Changes is a good template for this specific case, but I'd like a better understanding of what's really going on under the hood. Okay, then where do I get started?

For what it's worth, I'm already using jQuery in my Rails3 app.

like image 247
fearless_fool Avatar asked Oct 25 '22 02:10

fearless_fool


1 Answers

Just like numbersblah said you need a memory queue. Take a look at apache activemq. It might just do what you need.

like image 79
swordfish Avatar answered Oct 27 '22 10:10

swordfish