To Home Page
IT 231 -- Project 5
One-to-many Relationships
- Goal: Create a Rails site with two scaffold-based controllers
that satisfy a one-many-relationship. Do not choose students and awards
(Example 30) or owners and pets (Example 31) as your models.
- For items marked with an asterisk, see the
One-to-many Relationships Tutorial for details.
- Name the rails folder Proj5Smith, where you replace Smith with your
last name.
- Create an application that manages two data tables created with
scaffolds. Rows in these tables will be referred to as the
primary model and the dependent model below. See examples of
one-to-many relationships in the Lecture Notes on 8/10. In the
One-to-many Relationships Tutorial,
the primary model is Student and the dependent model is Award.
- Include at least four fields each of your models.
- Modify the stylesheet that is used by the .html.erb pages in the project
to use your own colors and fonts. Use hex color codes for all colors.
- Add these extra enhancements. Add your own enhancements, such as
validations and extra text and images, as well.
Rearrange the text and controls on your pages if you wish. Here are the
required enhancements:
- Add an h1 or h2 heading to the show view.
- Add extra space between the columns and rows of the table on the
index view. Place borders around the td tags.
- Rename the labels on the index and show views to make them more user
friendly.
- Rename the labels on form (filename: _form.html.erb) to make them
more user friendly. This form is used by the new and update views.
- *On the dependent model form (_form.html.erb), replace the id for
the primary model object with a dropdown box that shows all of the
choices for primary model.
- * On the index and show views for the dependent model, replace the
id of the corresponding primary model object with a different field
in the primary model that is a more user friendly identifier. For example,
you could replace id by name.
- * On the index view of the primary model, for each row in the table,
add the count of the number of
dependent model objects that belong to the object in that row.
- * On the show view of the primary model, at the bottom of the page,
show a tabel of all of the dependent model objects that belong to that
object.
- * On the index view of the primary model, add a hyperlink to the
index view of the dependent model. On the index view of the dependent
model, add a hyperlink to the index view of the primary model.
- Grading Criteria: General Functionality: 20%;
Enhancements in Part 5: 40%;
Database Design: 15%; Styles and Layout: 15%;
Zipped and Submitted Correctly: 10%.