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

add multiple routes with erb in them #10

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
102 changes: 54 additions & 48 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,59 +1,65 @@
GEM
remote: https://rubygems.org/
specs:
capybara (2.5.0)
mime-types (>= 1.16)
nokogiri (>= 1.3.3)
rack (>= 1.0.0)
rack-test (>= 0.5.4)
xpath (~> 2.0)
coderay (1.1.0)
daemons (1.2.3)
diff-lcs (1.2.5)
eventmachine (1.0.8)
method_source (0.8.2)
mime-types (2.6.1)
mini_portile (0.6.2)
nokogiri (1.6.6.2)
mini_portile (~> 0.6.0)
pry (0.10.1)
addressable (2.6.0)
public_suffix (>= 2.0.2, < 4.0)
capybara (3.18.0)
addressable
mini_mime (>= 0.1.3)
nokogiri (~> 1.8)
rack (>= 1.6.0)
rack-test (>= 0.6.3)
regexp_parser (~> 1.2)
xpath (~> 3.2)
coderay (1.1.2)
daemons (1.3.1)
diff-lcs (1.3)
eventmachine (1.2.7)
method_source (0.9.2)
mini_mime (1.0.1)
mini_portile2 (2.4.0)
mustermann (1.0.3)
nokogiri (1.10.3)
mini_portile2 (~> 2.4.0)
pry (0.12.2)
coderay (~> 1.1.0)
method_source (~> 0.8.1)
slop (~> 3.4)
rack (1.6.4)
rack-protection (1.5.3)
method_source (~> 0.9.0)
public_suffix (3.0.3)
rack (2.0.7)
rack-protection (2.0.5)
rack
rack-test (0.6.3)
rack (>= 1.0)
rake (10.4.2)
require_all (1.3.2)
rspec (3.3.0)
rspec-core (~> 3.3.0)
rspec-expectations (~> 3.3.0)
rspec-mocks (~> 3.3.0)
rspec-core (3.3.2)
rspec-support (~> 3.3.0)
rspec-expectations (3.3.1)
rack-test (1.1.0)
rack (>= 1.0, < 3)
rake (12.3.2)
regexp_parser (1.4.0)
require_all (2.0.0)
rspec (3.8.0)
rspec-core (~> 3.8.0)
rspec-expectations (~> 3.8.0)
rspec-mocks (~> 3.8.0)
rspec-core (3.8.0)
rspec-support (~> 3.8.0)
rspec-expectations (3.8.3)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.3.0)
rspec-mocks (3.3.2)
rspec-support (~> 3.8.0)
rspec-mocks (3.8.0)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.3.0)
rspec-support (3.3.0)
shotgun (0.9.1)
rspec-support (~> 3.8.0)
rspec-support (3.8.0)
shotgun (0.9.2)
rack (>= 1.0)
sinatra (1.4.6)
rack (~> 1.4)
rack-protection (~> 1.4)
tilt (>= 1.3, < 3)
slop (3.6.0)
thin (1.6.3)
sinatra (2.0.5)
mustermann (~> 1.0)
rack (~> 2.0)
rack-protection (= 2.0.5)
tilt (~> 2.0)
thin (1.7.2)
daemons (~> 1.0, >= 1.0.9)
eventmachine (~> 1.0)
rack (~> 1.0)
tilt (2.0.1)
xpath (2.0.0)
nokogiri (~> 1.3)
eventmachine (~> 1.0, >= 1.0.4)
rack (>= 1, < 3)
tilt (2.0.9)
xpath (3.2.0)
nokogiri (~> 1.8)

PLATFORMS
ruby
Expand All @@ -70,4 +76,4 @@ DEPENDENCIES
thin

BUNDLED WITH
1.10.6
2.0.1
13 changes: 10 additions & 3 deletions app.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
class App < Sinatra::Base

get '/' do
erb :index
end
get '/hello' do
erb :hello
end

get '/goodbye' do
erb :goodbye
end

get '/date' do
erb :date
end

end
13 changes: 13 additions & 0 deletions views/date.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!DOCTYPE html>
<html>

<body>
<h1>
Today
</h1>
<p>
<%= Time.now.strftime("The date is %A, %B %d, %Y") %>
</p>
</body>

</html>
10 changes: 10 additions & 0 deletions views/goodbye.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<!DOCTYPE html>
<html>
<head>
<h1>
<% name = "Joe" %>
<%= "Goodbye #{name}" %>
</h1>
</head>

</html>
7 changes: 7 additions & 0 deletions views/hello.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<!DOCTYPE html>
<html>
<head>
<h1> Hello World. </h1>
</head>

</html>