Forum: Ruby on Rails How to save data with dynamic forms?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Human D. (Guest)
on 2006-04-23 02:32
(Received via mailing list)
Hello,
Imagine I have a form designer, which allow me to design a web form (at
run-time).
I don't have any idea how to save the data in db (table ddl?), so I can
easily list or search the data.

I though of writing the hash directly from the form to db, but I think
there
must be better solution(s)?

Any idea, articles or design pattern on the subject?

Thank you all in advance,
Dunnil
Bryan D. (Guest)
on 2006-04-23 05:15
What's your schema look like for having run-time defined forms? I would
think something like:

form_type --< field
form --< field_value
field_value >-- field
form >-- form_type

(Like my whacky crow's foot notation?)

If this is the case, then each entry in your form is actually a row, so
you can use collection-based form helpers (<%= input "field_value[]"
...) and get it all done pretty easily. There's a section on using
collection forms in the Agile book.
This topic is locked and can not be replied to.