Best way to add “co-author” feature to Rails App?

Course Queries Syllabus Queries 2 years ago

0 2 0 0 0 tuteeHUB earn credit +10 pts

5 Star Rating 1 Rating

Posted on 16 Aug 2022, this text provides information on Syllabus Queries related to Course Queries. Please note that while accuracy is prioritized, the data presented might not be entirely correct or up-to-date. This information is offered for general knowledge and informational purposes only, and should not be considered as a substitute for professional advice.

Take Quiz To Earn Credits!

Turn Your Knowledge into Earnings.

tuteehub_quiz

Answers (2)

Post Answer
profilepic.png
manpreet Tuteehub forum best answer Best Answer 2 years ago

I am working with Rails 3, and I have a model called User that authors a Syllabus. I would like to add the feature of "co-authoring" a syllabus, so the original author can invite a different user to make changes to the content.

Which options below makes more sense? (If there's something better, please let me know)

  1. make the author attribute an array attribute, so that Syllabus.author would be an array containing all of its authors

  2. create additional attributes to Syllabus, such as coauthor1, coauthor2

If the first one makes more sense, would you be able to specifically describe how would I make it an array attribute, and insert additional authors later?

One reason I was considering the second option was because that would allow a distinction between the original author and the other co-authors, enabling perhaps only the original author to delete the Syllabus, while other co-authors have limited authority?

profilepic.png
manpreet 2 years ago

You can also make linking table like this:

autorhs_syllabus
----------------------
id
author_id integer
syllabus_id integer
original_author boolean 

0 views   0 shares

No matter what stage you're at in your education or career, TuteeHub will help you reach the next level that you're aiming for. Simply,Choose a subject/topic and get started in self-paced practice sessions to improve your knowledge and scores.

tuteehub community

Join Our Community Today

Ready to take your education and career to the next level? Register today and join our growing community of learners and professionals.

tuteehub community