Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tha Beasts rule once again #5

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
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
14 changes: 14 additions & 0 deletions app.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,19 @@

class App < Sinatra::Base

get '/newteam' do
erb :newteam
end

post '/team' do
@team_name = params[:name]
@coach = params[:coach]
@point_guard = params[:pg]
@shooting_guard = params[:sg]
@small_forward = params[:sf]
@power_forward = params[:pf]
@center = params[:c]
erb :team
end

end
10 changes: 10 additions & 0 deletions views/newteam.erb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,16 @@
<title>Basketball Team Signup</title>
</head>
<body>
<form method="POST" action="/team">
<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="sf"></p>
<p>Power Forward: <input type="text" name="pf"></p>
<p>Center: <input type="text" name="c"></p>
<input id="Submit" type="submit">
</form>
</body>
</html>

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



<h1>Team Name: <%= @team_name %></h1>
<h2>Coach: <%= @coach %></h2>
<h2>Point Guard: <%= @point_guard %></h2>
<h2>Shooting Guard: <%= @shooting_guard %></h2>
<h2>Small Forward: <%= @small_forward %></h2>
<h2>Power Forward: <%= @power_forward %></h2>
<h2>Center: <%= @center %></h2>
</body>
</html>

Expand Down