From ff578287df45aef1272fdbc56c81bdcdaabb7cb8 Mon Sep 17 00:00:00 2001 From: Nick Wohnhas Date: Thu, 28 Jun 2018 10:18:16 -0400 Subject: [PATCH] Done. --- app.rb | 12 ++++++++++-- views/date.erb | 18 ++++++++++++++++++ views/goodbye.erb | 11 +++++++++++ views/hello.erb | 10 ++++++++++ 4 files changed, 49 insertions(+), 2 deletions(-) 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..397caa5 100644 --- a/app.rb +++ b/app.rb @@ -1,8 +1,16 @@ class App < Sinatra::Base - get '/' do - erb :index + 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..16abe85 --- /dev/null +++ b/views/date.erb @@ -0,0 +1,18 @@ + + + + + + + + <% t = Time.now %> + <% day = t.strftime("%A") %> + <% month = t.strftime("%B")%> + <% year = t.strftime("%Y")%> + <% num_day = t.strftime("%d") %> +

Today

+

The date is <%= "#{day}, #{month} #{num_day}, #{year}" %>

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

<%= "Goodbye #{name}" %>

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

Hello World

+ + +