I just got pagination to work with Ajax ( http://wiki.rubyonrails.com/
rails/pages/How+to+Paginate+With+Ajax ) and I’m pretty happy with it.
However, I have a few observations.
With my production app I am/was using the iframe approach to swapping
out div sections. In AWDR it says that XMLHttpRequest is preferred
over this method for various reasons. However, until I read that and
implemented it, I always thought that Rails Ajax apps didn’t
necessarily swap out fragments but instead just inserted/updated the
relevant pieces of a div via XML returned from Ajax. The fact that it
is swapping fragments is still nice, but kinda bums me out a bit as I
was hoping for something more ‘sexy’.
That said, the Rails Ajax impl is much more robust and cleaner than
what I had been using before with iframe plus it’s integrated very
nicely. I know too that you can manipulate the DOM tree w/a Ajax
response but I don’t think I’m there yet.
Question is, do people prefer to just swap out the fragments or use
the DOM XML update approach? Would be interesting to find out how
many people prefer what and how long development time to do that is.