Virtual/dynamic tables?

Hi,

I’m trying to figure out a way for my users to create their own forms
and store the data collected into their own customized table.

For an example (though unlikely), say they want to create their own
variant of an address book. They specify the fields, some field
requirements (unique, size limit), perhaps a regex expression
(possibly from a list of examples) to validate the data, then I create
the forms for creation/update and the views for browsing, searching,
deleting.

Is there a plugin or example out there that can help with something
like this?

For dynamic creation of the storage, I was thinking of an architecture
like so:

  1. VirtualTable:
    • name:string
    • user_id:integer
  2. DataColumn:
    * virtual_table_id:integer
    * name:string
    * data_type:string
    * limit:integer
    * regex_validator:string
    * unique:boolean
  3. DataRow
    * virtual_table_id:integer
    * created_at:datetime
    * updated_at:datetime
  4. DataString
    * data_column_id:integer
    * data_row_id:integer
    * data_value:string
  5. DataText
    * data_column_id:integer
    * data_row_id:integer
    * data_value:text

I’m guessing I’d have to put most of the CRUD logic in a single model,
perhaps called VirtualData. Hopefully, the controller can just do
something like VirtualData.create params, and the magic happens inside
the model.

I haven’t worked out the details there yet.

Is there a better way?

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs