A table has many columns and a columns belongs to a table. Each column has many rows. Each row is a cell that would represent some sort of data type. You'll probably have to store some sort of ordinal to keep the rows and columns in order. It's gonna be slow. If you have any 3GL experience, it would be a list of lists used as a multi- dimensional array.
Another approach would be to have a limit on the number of columns and allow the user to 'add' columns by actually unhiding them. This is less dynamic, but a lot faster and simpler. On Nov 14, 1:26 am, Pragma Once <[email protected]> wrote: > Hi, > I am making a web application that basically allows user to create a > table. They name the table and add columns (field). Then they add > entries (rows), just like a typical table. > > So for example, the user can create a table called "High-Scores". Then > add fields "Name", "Points", "Achievements". These 3 will be the > columns. Then they can add an entry, so for example, "John", "123", > "Gold". > > How would I model this with a ruby class? Basically, from what I have > learned from tutorial so far, the models have predetermined fields. Now, > I have dynamic fields. > > Thanks for your help. > > -- > Posted viahttp://www.ruby-forum.com/. -- 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.

