Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6806755
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T19:44:58+00:00 2026-05-26T19:44:58+00:00

I am not sure exactly what I should name this question. I just started

  • 0

I am not sure exactly what I should name this question. I just started server-side programming and I need some help.

All the tutorials I have read so far on RoR deal with creating a pre-defined table and with pre-defined fields (id, name, email, etc etc). They use ActiveRecord as base class and saving to db is handled automatically by superclass.

What I am trying to program is something that allows user-defined table with fields. So think of this way. The web UI will have an empty table, the user will name the table, and add columns (field), and after that, add rows, and then later save it. How would I implement this? I am not asking for details, just an overview of it. As I said, all the tutorials I have read so far deal with pre-defined tables with fields where the ActiveRecord subclass is predefined.

So in a nutshell, I am asking, how to create tables in db on runtime, and add fields to the tables.

Hope I was clear, if not, please let me know and i will try to elaborate a bit more.
Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T19:44:58+00:00Added an answer on May 26, 2026 at 7:44 pm

    Unless you’re building a DB administration tool (and even maybe then), allowing the user direct access to the database layer in the way you’re suggesting is probably a bad idea. Apart from issues of stability and security, it’ll get really slow if your users are creating lots of tables.

    For instance, if you wanted to search for a certain value across 100 of your users’ tables, you’d have to run 100 separate queries. The site would get exponentially slower the more user tables that were created.

    A saner way to do it might be to have a Table model like this

    class Table < ActiveRecord::Base
      has_many :fields
      has_many :rows
    end
    

    Every table would have fields attached to it, and rows to store the corresponding data (which would be encoded somehow).

    However, as @Aditya rightly points out, this is not really beginner stuff!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Not sure exactly how to word this question ... so edits are welcomed! Anyway
Not sure exactly what I need to do to make this work, so my
I'm not sure exactly how to explain this, so I'll just start with an
I have this scenario and I'm not sure exactly how it should be modeled
I'm not sure exactly where this is happening, but what I'm trying to do
I'm not sure how to go about this exactly. I have a static ObservableCollection
I'm not quite sure what this is called, but I've spent some time thinking
I am trying to build a thumbnail slider(not sure it is the name) exactly
I'm not sure exactly how this is called but I'll try to describe as
I'm not sure exactly how to get this. What I have is something like

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.