From: David Teare Date: 2005-08-18T21:54:25+09:00 Subject: Re: New site built using Ruby on Rails For the most part, implementing Ajax in Rails is very easy. The hard part (IMHO) is manipulating the DOM, styling with CSS, implementing nifty JS code, etc. What Rails does, is take care of the server-side burden such that you have time to think about the UI. In most J2EE projects, I'm happy if the server side works, and don't have time to make a fancy UI. One thing that bites you with Ajax is the back button. If you manipulate the DOM, then go to a new page and use the back button to come back, the browser will render the _original_ HTML - all your DOM manipulations are lost. This will confuse your user so you need to take special care - for instance GMail uses a frame-based approach s.t they can store state in one of the frames; whereas palmsphere.com elected to initiate an ajax request onload to retrieve the current state and then re-render the DOM. --Dave. On 16-Aug-05, at 8:37 PM, Kirk Haines wrote: > On Tuesday 16 August 2005 6:14 pm, Scott Ellsworth wrote: > > >>> Doing this on paper is a hassle, but with a Ajax powered Ruby web >>> app, >>> it's fast and easy. Select a project and an employee, and a box >>> comes up >>> to enter start time and scheduled hours. Enter those, and it >>> pops up in >>> the schedule grid. Click on a box in the grid, and a form opens >>> up to >>> enter the information for that guy/project/day. Edit or delete the >>> information, and the changes go out to the grid. >>> >> >> This sounds really keen. Two questions: >> >> Is the representation of Rails and AJAX at >> fair? >> It seems amazingly straightforward to do, which always pushes my >> doubt >> buttons. >> > > I really have no idea as I'm not a Rails user. It is really the > rest of what > you want to do with the data and the rest of the DOM manipulations > to get the > effects that you want that are the hard part. Throwing data back > and forth > with xmlhttprequest and some supporting library is the easy part. > > >> Is the above URL the best place to start when trying to learn how >> to use >> AJAX with Rails? >> > > Again, I have no idea on this. For Rails, there is a mailing list > as well as > the #rubyonrails channel on freenode.net. > > >> (I have a budget app I have been meaning to write that needs a >> similar >> grid structure.) >> > > As I said, the ajax parts shouldn't be hard. Much trickier are > issues like > inserting new rows into the table or keeping track of which grid > element you > are editing data for so that you can make sure your updates go back > to the > right places. Once you get that ironed out, though, the rest of it > should > come together easily. > > > Kirk Haines > >