I'm pretty new to rails and have just begun playing around with creating a rails survey app to help better understand a nested data structure. I know I'm going to configure it so that a Survey has_many Questions. What I'm wondering is should I create another object "Answer" to just store each answer response and say a Question has_many Answers? Or should I just look into storing that information into the Question objects themselves? Really the only content that an answer will have is it's name.
I guess I'm looking for recommendations for how to handle this type of nested data structure.
Also, I haven't given too much though with how I would store responses - would having Answers as separate objects be easier to store/display the outcome of the survey?
May be this structure will be useful for you
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.