You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+13-12Lines changed: 13 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,30 +11,31 @@ In this lab, you'll practice building nested forms in Sinatra for creating teams
11
11
12
12
### Make a form
13
13
14
-
1. Create a route that responds to a GET request at `/`.
15
-
2. Create a view with a form and render it in the GET `/` route.
16
-
3. The form should have fields for the `name` of a superhero team and their `motto`.
17
-
4. There should be form inputs for each of the three superhero member's `name`, `power`, and `bio`.
14
+
1. Create a route that responds to a GET request at `/team`.
15
+
2. Create a view with a form and render it in the GET `/team` route.
16
+
3. The form should have fields for:
17
+
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')
18
25
19
26
It should look something like this:
20
27
21
28

22
29
23
30
### Handle form submission
24
31
25
-
1. Create a route that responds to a POST request at `/teams`
32
+
1. Create a route that responds to a POST request at `/team`
26
33
2. Have the form send a POST request to this route.
27
34
2. Upon submission, render a template that displays the submitted team data and each member's data.
28
35
29
36
## Final Output
30
37
31
-
Your params should be nested. For example, you would access the first super-hero's name as:
32
-
33
-
```ruby
34
-
params["team"]["members"][0][name]
35
-
```
36
-
37
-
When you post to this form you should render a page that displays the name of the team and each member of the team, along with their name, super power and bio.
38
+
When you post to this form you should render a page that displays the name of the team and each member of the team.
0 commit comments