0
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

View File

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