Congratulations! You have been hired by Access Camp and for your first job, you have been tasked with building out a website to log campers with their activities.
A camper
can participate in many activities
and an activity
can have many campers
participating in it.
Visiting /campers
will show the index page of all the campers and visiting /activities
will go to the index page for all the activities
.
Currently, we don't have any way to associate the two, so consider the relationship and think about how a camper
can signup
for an activity
!
The data to be saved to the database can be found in the seeds.rb
. Use the information in there to determine how to structure your tables!
-
To log a camper with an activity, we need to store some additional information in our database. Make the necessary updates to our database, so that a
camper
can have manyactivities
and anactivity
can have manycampers
. Thesignup
should also include a time (as an integer) that is between 0 and 23, referring to the hour of the activity. -
As a user, I should be able to go to the index page of the
campers
and see the list of all the campers in my database. When I click a name, I should go to the show page for thatcamper
. The show page should show thecamper's
name, their age and the list of activities that they have signed up for. -
As a user, I should be able to go to the index page of the
activities
and see the list of all the activities in my database. When I click a name, I should go to the show page for thatactivity
. The show page should show theactivity's
name and its difficulty level. -
As a user, I should be able to fill out a form to create a new
signup
that will associate acamper
with anactivity
. I should be able to choose an existingactivity
, choose an existingcamper
and add a time. Upon a successful creation, I should be redirected to thecamper's
show page. -
As a user, I should be able to fill out a form to create a new
camper
, with their names and age!
- Remember we want to be RESTful. What URL should show info about a particular camper? What URL should show a form to create a signup? lsWhat controller actions are associated?