Added ability to view message
This commit is contained in:
parent
498ecf76f5
commit
0da1fea1ec
@ -30,4 +30,13 @@ class Destructo < Sinatra::Base
|
||||
redirect '/'
|
||||
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
|
||||
|
5
views/message/view.erb
Normal file
5
views/message/view.erb
Normal file
@ -0,0 +1,5 @@
|
||||
<div class="row">
|
||||
<div class="twelve columns">
|
||||
<p><%= message.body %></p>
|
||||
</div>
|
||||
</div>
|
Loading…
Reference in New Issue
Block a user