0

I have a series of images that appear in a folder online that i can read and access in Ruby on Rails.

Here's what I want to happen: as images are added to that folder, i would like a live website to automatically load the new images and have them appear on the page with having to hit refresh (or refreshing the whole page, as i don't want to interrupt the ux since people will be using this page while it's also updating) The functionality i am looking for is sort of similar to the "auto load new posts while scrolling" i've seen on a few sites, like facebook.

I'm thinking i'll need to use ajax to run a server-side page that will grab the new images and return them to the visible div via JSON or something, right? I cant do this with only jQuery?

I'm fairly new to RoR, but i've working with PHP on and off for forever.

Any insight is greatly appreciated and i'll vote up any input that helps me.

Thanks in advance!

afxjzs
  • 982
  • 3
  • 10
  • 19

1 Answers1

0

Yes, you will have to use AJAX.

AJAX long polling <- see that link for more information on ONE of the ways you can accomplish this.

Community
  • 1
  • 1
Dhaivat Pandya
  • 6,499
  • 4
  • 29
  • 43