|
1 | | -# Basketball Season! |
| 1 | +# Sinatara Forms Lab |
2 | 2 |
|
3 | | -## Description |
| 3 | +## Overview |
4 | 4 |
|
5 | 5 | In this lab, you'll practice building forms in Sinatra by creating a basketball team sign-up sheet. Your application will have a basic html form, and will display the data from the form after it has been submitted by the user. |
6 | 6 |
|
7 | 7 | ## Instructions |
8 | 8 |
|
9 | | -1. `bundle install` |
10 | | -2. `bundle exec shotgun` |
| 9 | +1. Run `bundle install` |
11 | 10 |
|
12 | | -### Make a form |
| 11 | +2. Run `bundle exec shotgun` |
13 | 12 |
|
14 | | -1. Create a route that responds to a GET request at `/team`. |
15 | | -2. Add a form to the `team.erb` template and render it in the GET `/team` route. |
16 | | -3. The form should have fields for: |
| 13 | +3. Make a form |
17 | 14 |
|
18 | | -+ Team name ('name') |
19 | | -+ Coach ('coach') |
20 | | -+ Point Guard ('pg') |
21 | | -+ Shooting Guard ('sg') |
22 | | -+ Power Forward ('pf') |
23 | | -+ Small Forward ('sf') |
24 | | -+ Center ('c') |
| 15 | + Create a route that responds to a GET request at `/team`. |
| 16 | + Add a form to the `team.erb` template and render it in the GET `/team` route. |
| 17 | + The form should have fields for: |
| 18 | + Team name ('name') |
| 19 | + Coach ('coach') |
| 20 | + Point Guard ('pg') |
| 21 | + Shooting Guard ('sg') |
| 22 | + Power Forward ('pf') |
| 23 | + Small Forward ('sf') |
| 24 | + Center ('c') |
25 | 25 |
|
26 | | -It should look something like this: |
| 26 | + It should look something like this: |
27 | 27 |
|
28 | | - |
| 28 | +  |
29 | 29 |
|
30 | | -### Handle form submission |
| 30 | +4. Handle form submission |
31 | 31 |
|
32 | | -1. Create a route that responds to a POST request at `/team` |
33 | | -2. Have the form send a POST request to this route. |
34 | | -3. Upon submission, pass the submitted data to the `newteam.erb` template. |
| 32 | + Create a route that responds to a POST request at `/team` |
| 33 | + Have the form send a POST request to this route. |
| 34 | + Upon submission, pass the submitted data to the `newteam.erb` template. |
35 | 35 |
|
36 | | -## Final Output |
| 36 | +5. Final Output |
37 | 37 |
|
38 | | -Update the `newteam.erb` template so when you post to this form, it displays the name of the team and each member of the team. |
| 38 | + Update the `newteam.erb` template so when you post to this form, it displays the name of the team and each member of the team. |
39 | 39 |
|
40 | | -Your view should display something like this: |
| 40 | + Your view should display something like this: |
41 | 41 |
|
42 | | - |
| 42 | +  |
43 | 43 |
|
44 | | -## Deliverables |
| 44 | +6. Deliverables |
45 | 45 |
|
46 | | -Pass the tests! |
| 46 | + Pass the tests! |
47 | 47 |
|
48 | 48 | ## Resources |
49 | 49 | * [Ashley William's GitHub](https://github.com/ashleygwilliams/) - [Sinatra Form Party](https://github.com/ashleygwilliams/sinatra-form-party) |
|
0 commit comments