Added ability to view message

This commit is contained in:
Gregory Ballantine 2024-07-03 11:29:15 -04:00
parent 498ecf76f5
commit 0da1fea1ec
2 changed files with 14 additions and 0 deletions

View File

@ -30,4 +30,13 @@ class Destructo < Sinatra::Base
redirect '/' redirect '/'
end end
get '/message/:message_slug' do
message = Message.where(slug: params[:message_slug]).first()
erb :'message/view', locals: {
title: 'View message',
message: message
}
end
end end

5
views/message/view.erb Normal file
View File

@ -0,0 +1,5 @@
<div class="row">
<div class="twelve columns">
<p><%= message.body %></p>
</div>
</div>