Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions app.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,18 @@

class App < Sinatra::Base

get '/newteam' do
erb :newteam
end

post '/team' do
@name = params[:name]
@coach = params[:coach]
@pg = params[:pg]
@sg = params[:sg]
@sf = params[:sf]
@pf = params[:pf]
@c = params[:c]
erb :team
end
end
11 changes: 11 additions & 0 deletions views/newteam.erb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,17 @@
<title>Basketball Team Signup</title>
</head>
<body>
<form method="POST" action="/team">
<h1>Create a Basketball Team!</h1>
<p>Team Name:<input type="text" name="name"></p>
<p>Coach:<input type="text" name="coach"></p>
<p>Point Guard:<input type="text" name="pg"></p>
<p>Shooting Guard:<input type="text" name="sg"></p>
<p>Small Forward:<input type="text" name="pf"></p>
<p>Power Forward:<input type="text" name="sf"></p>
<p>Center:<input type="text" name="c"></p>
<input type="submit" id = "Submit">
</form>
</body>
</html>

Expand Down
8 changes: 7 additions & 1 deletion views/team.erb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,13 @@
<title>Basketball Team</title>
</head>
<body>

<h1>Team Name: <%= @name%> </h1>
<h2>Coach: <%= @coach%> </h2>
<h2>Point Guard: <%= @pg %> </h2>
<h2>Shooting Guard: <%= @sg%> </h2>
<h2>Small Forward: <%= @sf%> </h2>
<h2>Power Forward: <%= @pf%> </h2>
<h2>Center: <%= @c%></h2>


</body>
Expand Down