Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

adding a 'not found' page

  • Loading branch information...
commit 99afc640f812560a0addb0eea4ac16e5f12dbd42 1 parent e59bd6f
@garu authored
Showing with 10 additions and 0 deletions.
  1. +10 −0 tweetylicious.pl
View
10 tweetylicious.pl
@@ -123,6 +123,10 @@ package main;
my $self = shift;
my $user = $self->param('user');
+ # renders our error page unless the user exists
+ return $self->render('not_found')
+ unless Model::User->count('WHERE username = ?', $user);
+
# fill our stash with information for the template
$self->stash(
user => Model::User->load( $user ),
@@ -273,6 +277,12 @@ package main;
<p>Have fun!</p>
</div>
+@@ not_found.html.ep
+% layout 'main';
+<div id="content" class="full ui-corner-all">
+<h3>Sorry, we couldn't find the page you were looking for :-(</h3>
+</div>
+
@@ static.css.ep
body {
width:720px;
Please sign in to comment.
Something went wrong with that request. Please try again.