Skip to content

Commit 55731d3

Browse files
committed
removed solution
1 parent fce1b67 commit 55731d3

4 files changed

Lines changed: 6 additions & 34 deletions

File tree

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
# Superheroes!
1+
# Basketball Season!
22

33
## Description
44

5-
In this lab, you'll practice building nested forms in Sinatra for creating teams of superheros. No database is required, but feel free to add persistence *after* you have successfully completed the instructions below.
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.
66

77
## Instructions
88

app.rb

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,5 @@
22

33
class App < Sinatra::Base
44

5-
get '/team' do
6-
erb :team
7-
end
8-
9-
post '/team' do
10-
@name = params[:name]
11-
@coach = params[:coach]
12-
@pg = params[:pg]
13-
@sg = params[:sg]
14-
@sf = params[:sf]
15-
@pf = params[:pf]
16-
@c = params[:c]
17-
erb :newteam
18-
end
195

206
end

views/newteam.erb

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,7 @@
55
<title>Basketball Team</title>
66
</head>
77
<body>
8-
<h1>Team Name: <%=@name%></h1>
9-
<h2>Coach: <%=@coach%></h2>
10-
<h2>Point Guard: <%=@pg%></h2>
11-
<h2>Shooting Guard: <%=@sg%></h2>
12-
<h2>Small Forward: <%=@sf%></h2>
13-
<h2>Power Forward: <%=@pf%></h2>
14-
<h2>Center: <%=@c%></h2>
8+
159
</body>
1610
</html>
1711

views/team.erb

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,11 @@
22
<html>
33
<head>
44
<meta charset="UTF-8">
5-
<title>Basketball Team</title>
5+
<title>Basketball Team Sign Up</title>
66
</head>
77
<body>
8-
<form method="POST" action="/team">
9-
<p> Team Name: <input type="text" name="name"> </p>
10-
<p>Coach: <input type="text" name="coach"></p>
11-
<p>Point Guard:<input type="text" name="pg"></p>
12-
<p>Shooting Guard:<input type="text" name="sg"></p>
13-
<p>Small Forward:<input type="text" name="sf"></p>
14-
<p>Power Forward:<input type="text" name="pf"></p>
15-
<p>Center: <input type="text" name="c"></p>
16-
<p><input type="submit"></p>
17-
</form>
8+
<h1> Sign Up Your Basketball Team </h1>
9+
1810
</body>
1911
</html>
2012

0 commit comments

Comments
 (0)