From e2724943c563356ae6185035219bbeef02c99060 Mon Sep 17 00:00:00 2001 From: Lauren Abrams Date: Thu, 28 Jun 2018 10:00:43 -0400 Subject: [PATCH] added new erb files to views directory and used erb to link files --- app.rb | 11 +++++++++++ views/date.erb | 2 ++ views/goodbye.erb | 2 ++ views/hello.erb | 10 ++++++++++ 4 files changed, 25 insertions(+) create mode 100644 views/date.erb create mode 100644 views/goodbye.erb create mode 100644 views/hello.erb diff --git a/app.rb b/app.rb index 254fe3f..137ae30 100644 --- a/app.rb +++ b/app.rb @@ -4,5 +4,16 @@ class App < Sinatra::Base erb :index end + get "/hello" do + erb :hello + end + + get "/goodbye" do + erb :goodbye + end + + get "/date" do + erb :date + end end diff --git a/views/date.erb b/views/date.erb new file mode 100644 index 0000000..64f41d9 --- /dev/null +++ b/views/date.erb @@ -0,0 +1,2 @@ +

Today

+

The date is <%= DateTime.now.strftime("%A, %B %e, %Y") %>

diff --git a/views/goodbye.erb b/views/goodbye.erb new file mode 100644 index 0000000..b09b1b2 --- /dev/null +++ b/views/goodbye.erb @@ -0,0 +1,2 @@ +<% name = "Joe" %> +

Goodbye <%= name %>

diff --git a/views/hello.erb b/views/hello.erb new file mode 100644 index 0000000..7b65dc2 --- /dev/null +++ b/views/hello.erb @@ -0,0 +1,10 @@ + + + + + Hello + + +

Hello World

+ +