For this challenge, you'll be adding some new functionality to a very basic Sinatra+ActiveRecord application. The application in its current form includes:
- a
User
model (along with sign-in and sign-up functionality) - a
Skill
model (representing a skill that a user might have)
Your task is to add the notion of "proficiency" to the application. A user can have many skills, and a skill can belong to many users. A "proficiency" is an association between User
s and Skill
s, and has the following additional required attributes:
- years of experience
- a flag tracking whether or not the user has formal education for the given skill
You'll need to provide an interface in the application for users to select the skills that they have. How you choose to provide this interface is up to you, but a user should only be able to edit her own skills, not the skills of other users.
Also, the home page of your application should simply show each user, along with each of her skills, how many years experience she has with said skill, and whether or not she's been formally educated in that skill. For example:
<style> tr.new-user { border-top: 1px dotted grey; } th { text-align: left; } td { padding-right: 40px; } </style>Name | Skill | Years | Formal? |
---|---|---|---|
Amanda Huggenkyss | Ruby (technical) | 1 | yes |
JavaScript (technical) | 2 | yes | |
Ben Dover | Illustrator (creative) | 5 | no |
CSS (technical) | 3 | no |
You should start with this applicaiton skeleton.
- What's the right kind of association between
User
andSkill
? - Validations on boolean fields can be tricky.
- Before implementing a manual way to add new proficiencies for a user, you might try adding some through your
seeds.rb
file.