fearless_fool
fearless_fool

Reputation: 35179

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.

Upvotes: 5

Views: 241

Answers (3)

Kevin
Kevin

Reputation: 15974

Rails Guides is another great resource: http://edgeguides.rubyonrails.org/working_with_javascript_in_rails.html

Upvotes: 0

Brian Genisio
Brian Genisio

Reputation: 48137

RailsCasts.com is a really great resource:

http://railscasts.com/episodes?utf8=%E2%9C%93&search=ajax

Upvotes: 1

swordfish
swordfish

Reputation: 4995

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

Upvotes: 2

Related Questions