<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
<a class="moz-txt-link-abbreviated"
href="mailto:fritz-bayer-S0/GAf8tV78@public.gmane.org">fritz-bayer-S0/GAf8tV78@public.gmane.org</a>
wrote:
<blockquote
cite="mid:c9dd03f4-de61-4704-8eff-da0939c12458-hieCf5PoeAY41w2X2TWwk2B/v6IoIuQB4b8TPpkIZ3Q@public.gmane.orgcom"
type="cite">
<pre wrap="">Hi,
I''m new to rails and I have a question about how to manage state in
rails application in general.
How would I solve the following szenario:
I have an application in which a user has to fill out a html form.
This form corresponds to a/the main model, for example an organizer
who hosts several events.
On the same page the user can select a link, which will lead him to
another html page on which he can create events and save them.
After the user has saved the event he will automatically be sent back
to the page from which he came and the event will be added to the
organizer''s event list.
Now the problem is this:
1. The user fills out the first form with information about an
organizer and then clicks on the "create events" link.
2. He arrives at the event page and fill out the form with the event
information and is sent back to where he came from
Now, all the selections and user input the user has made about the
organizer is lost, because the organizer was not saved yet.
How do you handle conversations in rails between the user and the
application in which several models have to be initialized first and
then saved all together?
The user can also return to the previous pages/forms and make changes?
It would be ideal if the models could be tied directly to the forms
and the models are synchronized with the user forms everytime the user
moves to a different page.
But I guess, because of rails restfull design architecture this is
done automatically, but can only be achieved manually by
synchroinizing the session with the input of the user from the forms?!
How do you implement wizard like navigation in rails? Are there any
plugins? Do you have something like a conversation in seam/java?
Fritz
</pre>
</blockquote>
May not be the best way but what I have done is to save it to the db
with a flag indicating that it is not confirmed. Later when all of the
data is gathered I will set the flag (in the db) indicating this is
valid data. I also periodicly go through the db destroying old entries
where the data is not confirmed.<br>
<br>
YMMV<br>
Norm<br>
<br>
--~--~---------~--~----~------------~-------~--~----~<br>
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group. <br> To post to this group,
send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
<br> To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org <br>
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en<br>
-~----------~----~----~----~------~----~------~--~---<br>
</body>
</html>
<br>