Ajax and the submit

While working on a new application, a friend and I ran into what we
think is a problem with using ajax. Users are used to being able to
modify the contents of a screen until they are finished and then saving
(committing). There does not seem to be a way to do this with ajax,
since you have to modify the model whenever you call back to the server.
The half baked solution that we came up with is to create a copy of the
child collections and the parent in the session, and modify them. Once
the user submits, everything is then taken from the session and
committed. Is there a better way to allow for this kind of functionality
and use ajax?

I thought about doing the same thing. The problem with that is if the
walks away and the session dies. My solution was to create the records
immediately (on the “new” action) , put the id in the session, and then
always use that as a reference to update the DB. When all is said and
and they click “Submit”, THEN I associate the record(s) with the user.

Hope that helps.

  • Matt

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs