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

  • SEARCH
  • Home
  • 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 6890001
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T06:13:37+00:00 2026-05-27T06:13:37+00:00

First time posting in Stack Overflow, hope I’m doing this right. I’m writing an

  • 0

First time posting in Stack Overflow, hope I’m doing this right.

I’m writing an app with Ruby on Rails right now. Without disclosing too much, the premise is that we have organizations and normal users. Organizations have events, which require users to answer a questionnaire before participating.

I’m pretty sure about these models / relationships that I will be using (this isn’t really that important/pertinent to my question i think, but just wanted to give background):

  • organization (one to many) events
  • event (one to one) quesitonnaire)
  • questionnaire (one to many) users
  • (specific) response (one to one) user

The part I have a question about is how to implement the questionnaire. I want to give the ability to Organizations to essentially write / build their own forms. I’d like to stay away from them using code if that’s possible (ie any DSL and whatnot).

I suppose the easiest way to do this is to give them a set number of text-area responses, so that I can consistently store the data and don’t have to hassle around with how to configure storing this data (for example, maybe each event can only have exactly 5 responses to be filled in by textfield response by the user).

My ideal would be for the organization to be able to dynamically generate the forms on their own – maybe one questionnaire will have 1 text input, followed by 3 multiple choices, and maybe 2 short answers at the end; another one may have 5 multiple choices, and 1 short answer; yet another questionnaire might only have 1 text input…you get the idea.

So I see two parts of this problem – the first is the user interface for the organization to create the questionnaire. i’m imagining this wouldn’t be terribly hard – ask them how many of each response type (MC, short answer) they would like to put into the form, give them the ability to rearrange them, etc.

The second part of the problem (what I’m more concenred about) is how to store/access this data. I’m guessing there’s no dynamic-attribute sort of deal in ruby – storing some field with an unspecified number of parts and whatnot. i suppose i could make them all individual models (ie a question_response model, with :question, :response_type, :response, etc), but I’m fairly certain that’s probably inefficient.

My initial guess is probably to serialize the data / use json; I worked briefly with Drupal 6 and this seems to be the way they did it. I was wondering if anyone else had any experience / suggestions though? I’m pretty new to Ruby so I was wondering if there’s a gem out there or something that would help with what I’m trying to do.

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-27T06:13:37+00:00Added an answer on May 27, 2026 at 6:13 am

    You might want to look at the Surveyor gem

    http://vimeo.com/7051279
    *slightly old how-to video

    https://github.com/breakpointer/surveyor

    Surveyor does come with it’s own DSL which is relatively easy to use (although can be abit restrictive at times). The data is saved as a set of question – answer values, so there is no actual specific model (beyond Surveys -> Questions (question_groups) -> Answers).

    Originally I did look at having people submit their own Surveyor DSL specs – which would then be used to generate the actual survey via a Rake command.

    I think if you need to build a dynamic model (and save the data) it is possible, although I am not not sure if you’ll be able to get the Rake tasks to run to build the actual tables in a dynamic way due to permission restrictions.

    Have a look at http://ruby-metaprogramming.rubylearning.com/ and Metaprogramming Ruby: Program Like the Ruby Pros by Paolo Perrotta, for some starters.

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

Sidebar

Related Questions

First time posting on stack overflow. I've spent hours scouring over many Google searches
this is the second time I am posting this on stack overflow forum, the
First time posting on here, so I hope I do this correctly, however I
this is my first time posting my problem here, i hope i get help
this is my first time posting here, I have a question which I have
use this website a lot but first time posting. My program creates a number
First time Stack Overflow poster. Please bear with me! :) I have a set
This is my first time posting to stackoverflow, but these threads have helped me
This is the first time I am posting a question on stackoverflow, so please
this is my first time posting on here and have read alot of helpful

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.