0
0
Fork 0

redirect to 404, when post was not found

This commit is contained in:
Gibheer 2011-07-05 19:33:00 +02:00
parent 700d42fe54
commit 45a2dd1635
1 changed files with 1 additions and 2 deletions

View File

@ -12,8 +12,7 @@ class Blog < Sinatra::Base
get '/post/:id' do
@post = Post.get_released(params[:id])
if @post.nil?
flash.warning = 'Post not found!'
redirect '/'
404
else
haml :post_single
end