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

Created Create Team Form #15

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
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ gem 'sinatra'
gem 'rack-protection', '~> 2.0', '>= 2.0.1'
gem 'rake'
gem 'thin'
gem 'shotgun'
gem 'shotgun', git: 'https://github.com/delonnewman/shotgun.git'
gem 'pry'
gem 'require_all'

Expand Down
134 changes: 80 additions & 54 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,74 +1,100 @@
GIT
remote: https://github.com/delonnewman/shotgun.git
revision: 600b3987db7f4774e2305247ff374327f1837857
specs:
shotgun (0.9.2)
rack (>= 1.0)

GEM
remote: https://rubygems.org/
specs:
addressable (2.5.2)
public_suffix (>= 2.0.2, < 4.0)
capybara (2.18.0)
addressable (2.8.7)
public_suffix (>= 2.0.2, < 7.0)
capybara (3.40.0)
addressable
matrix
mini_mime (>= 0.1.3)
nokogiri (>= 1.3.3)
rack (>= 1.0.0)
rack-test (>= 0.5.4)
xpath (>= 2.0, < 4.0)
nokogiri (~> 1.11)
rack (>= 1.6.0)
rack-test (>= 0.6.3)
regexp_parser (>= 1.5, < 3.0)
xpath (~> 3.2)
cliver (0.3.2)
coderay (1.1.2)
daemons (1.2.6)
diff-lcs (1.3)
eventmachine (1.2.5)
method_source (0.9.0)
mini_mime (1.0.0)
mini_portile2 (2.3.0)
mustermann (1.0.2)
nokogiri (1.8.2)
mini_portile2 (~> 2.3.0)
poltergeist (1.17.0)
capybara (~> 2.1)
coderay (1.1.3)
daemons (1.4.1)
diff-lcs (1.5.1)
eventmachine (1.2.7)
matrix (0.4.2)
method_source (1.1.0)
mini_mime (1.1.5)
mustermann (2.0.2)
ruby2_keywords (~> 0.0.1)
nokogiri (1.16.7-aarch64-linux)
racc (~> 1.4)
nokogiri (1.16.7-arm-linux)
racc (~> 1.4)
nokogiri (1.16.7-arm64-darwin)
racc (~> 1.4)
nokogiri (1.16.7-x86-linux)
racc (~> 1.4)
nokogiri (1.16.7-x86_64-darwin)
racc (~> 1.4)
nokogiri (1.16.7-x86_64-linux)
racc (~> 1.4)
poltergeist (1.18.1)
capybara (>= 2.1, < 4)
cliver (~> 0.3.1)
websocket-driver (>= 0.2.0)
pry (0.11.3)
coderay (~> 1.1.0)
method_source (~> 0.9.0)
public_suffix (3.0.2)
rack (2.0.4)
rack-protection (2.0.1)
pry (0.14.2)
coderay (~> 1.1)
method_source (~> 1.0)
public_suffix (6.0.1)
racc (1.8.1)
rack (2.2.9)
rack-protection (2.2.4)
rack
rack-test (0.8.3)
rack (>= 1.0, < 3)
rake (12.3.0)
require_all (2.0.0)
rspec (3.7.0)
rspec-core (~> 3.7.0)
rspec-expectations (~> 3.7.0)
rspec-mocks (~> 3.7.0)
rspec-core (3.7.1)
rspec-support (~> 3.7.0)
rspec-expectations (3.7.0)
rack-test (2.1.0)
rack (>= 1.3)
rake (13.2.1)
regexp_parser (2.9.2)
require_all (3.0.0)
rspec (3.13.0)
rspec-core (~> 3.13.0)
rspec-expectations (~> 3.13.0)
rspec-mocks (~> 3.13.0)
rspec-core (3.13.0)
rspec-support (~> 3.13.0)
rspec-expectations (3.13.1)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.7.0)
rspec-mocks (3.7.0)
rspec-support (~> 3.13.0)
rspec-mocks (3.13.1)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.7.0)
rspec-support (3.7.1)
shotgun (0.9.2)
rack (>= 1.0)
sinatra (2.0.1)
mustermann (~> 1.0)
rack (~> 2.0)
rack-protection (= 2.0.1)
rspec-support (~> 3.13.0)
rspec-support (3.13.1)
ruby2_keywords (0.0.5)
sinatra (2.2.4)
mustermann (~> 2.0)
rack (~> 2.2)
rack-protection (= 2.2.4)
tilt (~> 2.0)
thin (1.7.2)
thin (1.8.2)
daemons (~> 1.0, >= 1.0.9)
eventmachine (~> 1.0, >= 1.0.4)
rack (>= 1, < 3)
tilt (2.0.8)
websocket-driver (0.7.0)
tilt (2.4.0)
websocket-driver (0.7.6)
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.3)
xpath (3.0.0)
websocket-extensions (0.1.5)
xpath (3.2.0)
nokogiri (~> 1.8)

PLATFORMS
ruby
aarch64-linux
arm-linux
arm64-darwin
x86-linux
x86_64-darwin
x86_64-linux

DEPENDENCIES
capybara
Expand All @@ -79,9 +105,9 @@ DEPENDENCIES
rake
require_all
rspec
shotgun
shotgun!
sinatra
thin

BUNDLED WITH
1.16.1
2.5.9
17 changes: 17 additions & 0 deletions app.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,22 @@

class App < Sinatra::Base

get "/newteam" do
erb :newteam
end

post "/team" do
@team = {
name: params[:name],
coach: params[:coach],
pg: params[:pg],
sg: params[:sg],
pf: params[:pf],
sf: params[:sf],
c: params[:c]
}
Comment on lines +10 to +18

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clever. Nice!

erb :team
end


end
1 change: 0 additions & 1 deletion spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
RSpec.configure do |config|
config.include Capybara::DSL
config.include Rack::Test::Methods
config.order = 'default'
end

def app
Expand Down
26 changes: 24 additions & 2 deletions views/newteam.erb
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,31 @@
<head>
<meta charset="UTF-8">
<title>Basketball Team Signup</title>
<form action="/team" method="post">
<label for="name">Team Name:</label>
<input type="text" id="name" name="name"><br><br>

<label for="coach">Coach:</label>
<input type="text" id="coach" name="coach"><br><br>

<label for="pg">Point Guard:</label>
<input type="text" id="pg" name="pg"><br><br>

<label for="sg">Shooting Guard:</label>
<input type="text" id="sg" name="sg"><br><br>

<label for="pf">Power Forward:</label>
<input type="text" id="pf" name="pf"><br><br>

<label for="sf">Small Forward:</label>
<input type="text" id="sf" name="sf"><br><br>

<label for="c">Center:</label>
<input type="text" id="c" name="c"><br><br>

<input type="submit" value="Submit">
</form>
</head>
<body>
</body>
</html>


22 changes: 12 additions & 10 deletions views/team.erb
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
<!DOCTYPE html>
<html>
<head>
<head>
<meta charset="UTF-8">
<title>Basketball Team</title>
</head>
<body>



</body>
<title>Team Name: <%= @team[:name] %></title>
</head>
<body>
<h1>Team Name: <%= @team[:name] %></h1>
<h2>Coach: <%= @team[:coach] %></h2>
<h2>Point Guard: <%= @team[:pg] %></h2>
<h2>Shooting Guard: <%= @team[:sg] %></h2>
<h2>Small Forward: <%= @team[:sf] %></h2>
<h2>Power Forward: <%= @team[:pf] %></h2>
<h2>Center: <%= @team[:c] %></h2>
</body>
</html>