This post has been de-listed
It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.
Hello
I'm relatively new to web programming so I'm iffy when it comes to best practices of most everything.
Currently I'm trying to recreate the Linkedin user profile page but I've hit something of a snag. See, each user has the option to enter a number of 'skills', 'languages' they know, 'certifications' and whatnot.
Initially, I thought that creating a 'Skill' model and storing each skill as a new row in the db was nuts (ie: (id=1, user_id= 15, skill_name=blabla), (id=2, user_id=15, skill_name=yaya)). So instead I decided to just have skill_name be an array, and store all the user skills in a single table row.
After a crapload of googling I managed to get the thing working properly; the user can remove, reorder and add skills to the array through some ajax shenanigans. However, now that I'm about to move on to doing other stuff I'm wondering if doing that was actually a good idea.
So my question is, was there a better way to handle that problem? Does it matter if a user has too many entries in a table (10 )? If it does, how many entries is too much?
I'm also wondering if doing the array thing for something like languages is a good idea. Unlike skills, I can probably limit languages to a max of 5? rows per User. Same for certifications, projects, publications etc.
I'm using the Rails framework btw.
Post Details
- Posted
- 7 years ago
- Reddit URL
- View post on reddit.com
- External URL
- reddit.com/r/webdev/comm...