Added a 404 error page; added some more linking between the pages

This commit is contained in:
Gregory Ballantine 2024-07-07 18:37:59 -04:00
parent e5022c5624
commit df53c44201
4 changed files with 20 additions and 0 deletions

12
src/routes/error.rb Normal file
View File

@ -0,0 +1,12 @@
# frozen_string_literal: true
# error handling routes
class Destructo < Sinatra::Base
error 404 do
erb :'error/404', locals: {
title: 'Page not found'
}
end
end

View File

@ -1,4 +1,5 @@
# frozen_string_literal: true # frozen_string_literal: true
require_relative 'error'
require_relative 'index' require_relative 'index'
require_relative 'message' require_relative 'message'

5
views/error/404.erb Normal file
View File

@ -0,0 +1,5 @@
<p>This page does not exist.</p>
<p>If you're looking for a message, it's possible that it has already been viewed and subsequently deleted.</p>
<p>If you would like to send a new message, head <a href="/">back home</a> to get started.</p>

View File

@ -1,5 +1,7 @@
<div class="row"> <div class="row">
<div class="columns twelve"> <div class="columns twelve">
<p>This is the home page.</p> <p>This is the home page.</p>
<p><a href="/message/new">Click here</a> to send a new message.</p>
</div> </div>
</div> </div>