Skip to content
Open

done #11

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
14 changes: 13 additions & 1 deletion app.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
require 'sinatra/base'

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]
@pf = params[:pf]
@sf = params[:sf]
@c = params[:c]
erb :team
end

end
14 changes: 11 additions & 3 deletions views/newteam.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,18 @@
<html>
<head>
<meta charset="UTF-8">
<title>Basketball Team Signup</title>
<title>Create A Basketball Team</title>
</head>
<body>
<form method="POST" action="/team">
<label>Team Name: <input type="text" name="name" /></label><br/>
<label>Coach: <input type="text" name="coach" /></label><br/>
<label>Point Guard: <input type="text" name="pg" /></label><br/>
<label>Shooting Guard: <input type="text" name="sg" /></label><br/>
<label>Power Forward: <input type="text" name="pf" /></label><br/>
<label>Small Forward: <input type="text" name="sf" /></label><br/>
<label>Center: <input type="text" name="c" /></label><br/><br/>
<input type="submit" value="Submit"/>
</form>
</body>
</html>


11 changes: 8 additions & 3 deletions views/team.erb
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,14 @@
<title>Basketball Team</title>
</head>
<body>



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

Expand Down