Topic: BYO type system | Dynamic Form Fields

Hi Everyone,

I've been looking for a tutorial or screen-cast that talks about building a BYO(Build Your Own) contact form type deal.

For example you might have a Product Model which each product has different options to select as available... now with product options you could create your own and choose a title | Option_type(input_field, drop_down, Check_box etc...) | Label

Those options would then be available when adding a new Product and you could choose or select etc.

any ideas on even a DB Diagram for something like this? or the location of a Screen cast or Tutorial?

Your help is much appreciated.


Re: BYO type system | Dynamic Form Fields


I have been thinking about this myself (to add i in a CMS).
As far as i know there isn't a screencast about it. (@ryanb if you read this, maybe a tip ? tongue )

You have two choices for the database:
The easiest one is to use a non relational db (like chouchDB
OR you create a bit more complex solution with table. From the top of my head you could do something like this:
Form table to connect your field to (so you could create multiple forms
text_field table for text_field (duh) (linked to the Form table)

radio table for creating radio possibilities (linked to the Form table)
A radio_options table (linked to radio table) for creating options for a radio

text_field table (linked to Form table)

select_field table (linked to Form table)

for the view you could use something like this:

I hope this is helpful tongue

Re: BYO type system | Dynamic Form Fields


Thank you for your reply... That is some awesome info my friend! thank you.

I had never thought about doing it that way...

so for my example i would have Product_Options which would have many >
Text_fields (tbl)
Select_fields (tbl)
check_boxs (tbl)

How would i then record the information for each based on adding of a product?

Thank you again this has definitely got me thinking in a different direction.

and i agree @ryanb if you want to do a RailCast on something like this big_smile feel free!! we love your work!


Re: BYO type system | Dynamic Form Fields

hehe np tongue

and yes that would be very hard to accomplish. This is complex form editing for professionals tongue
Ryan examplains complex forms in one of his screencasts.

just search on rails casts for complex forms (or something)