Forum: Ruby on Rails Ajax and the submit

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Phil Craven (Guest)
on 2006-01-31 07:32
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?
Matt S. (Guest)
on 2006-02-02 23:21
(Received via mailing list)
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 topic is locked and can not be replied to.