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:
- The user fills out the first form with information about an
organizer and then clicks on the “create events” link.
- 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
[email protected] wrote:
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:
- The user fills out the first form with information about an
organizer and then clicks on the “create events” link.
- 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
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.
YMMV
Norm
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Ruby on Rails: Talk" group.
To post to this
group, send email to
[email protected] To
unsubscribe from this group, send email to
[email protected] For more options,
visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---